Code Monkey home page Code Monkey logo

scratch's Introduction

Personal scratch code

This repository is a pile of scratch mini-projects I've written over the years that capture various experiments and lessons learned. When working on other projects, I will sometimes harvest code snippets from this scratch repository. Some of this code is complete, working, and tested, but not sufficiently substantial to warrant its own repository. Some is incomplete or half-baked. Almost all the code here is dedicated to the public domain.

scratch's People

Contributors

skeeto avatar tekknolagi avatar n-r-k avatar

Stargazers

Shahriar avatar Robert Weche avatar Jacob Zimmerman avatar Julien Guillot avatar weijh avatar  avatar  avatar Andrey S. avatar Nate avatar Rene avatar  avatar AdriOZ avatar Orlando B avatar dart avatar Denys Mentiei avatar  avatar  avatar ハル avatar James Anhalt avatar Александр avatar Hubert avatar  avatar Steven Johnson avatar Erin Catto avatar Dwi Andhika avatar Periklis Papanikolaou avatar Gregory Tereshko avatar Antonis Geralis avatar  avatar Pablo Hugo Reda avatar Loris Guerra avatar  avatar zg33 avatar Garfield Linden avatar Keroronsk avatar Wyoming avatar  avatar Chao avatar Jeremy Field avatar XilongPei avatar Jevin Sweval avatar Kelly Nawrocke avatar Stian Gudmundsen Høiland avatar Jianchang Su avatar  avatar Ricardo Antonio Tejada avatar Paolo avatar Le Quang Hoai avatar chris avatar Petri Väisänen avatar Lion avatar Y. Meyer-Norwood avatar Yusuf avatar Tim Lebedkov avatar Mebyus avatar James avatar Andreas Roussos avatar Kent Chen avatar  avatar Julian Heinken avatar  avatar  avatar  avatar Kostiantyn avatar Julio Gutierrez avatar  avatar Anton Håkansson avatar  avatar  avatar dh avatar  avatar Andrei Pechkurov avatar Terry avatar Bradley Jones avatar Alex Wu avatar  avatar  avatar Stefan avatar Christian Halter avatar  avatar Jet He avatar Emilio Bucur avatar  avatar Michael James Clift avatar  avatar  avatar Alessandro Stamatto avatar Karl Jonsson avatar  avatar Marc Benzahra avatar Steve Chavez avatar Budimir Filipovic avatar Sergey Bronnikov avatar Brooke avatar Kamil Shakirov avatar Philip Edwards avatar Paul Jarrett avatar Phaneron avatar Goode_Cheeseburgers avatar Jaedeok Kim avatar

Watchers

 avatar Kamil Shakirov avatar Jevin Sweval avatar Kaspter Ju avatar James Cloos avatar Luca Bolognese avatar Dmitry Atamanov avatar Stian Gudmundsen Høiland avatar Zhuo Zhang avatar  avatar Michal Vlasák avatar Jet He avatar Anton Håkansson avatar  avatar  avatar  avatar  avatar

scratch's Issues

Inverted srgb flag in parser/qoi.c

According to the spec, 0 means srgb and 1 means linear. But in the code, it seems to be doing the opposite:

    p[13] = 0;  // srgb
    // ...
    case 's': p[13] = 1; break;

splitxix33 fails PractRand consistently

Hi!

Doing some quick tests with splitxix33 and PractRand.
For 21 out of 21 different seeds I get failures, always with Gap-A or Gap-B, on average after 180 GB tested (failure at 128GB at the earliest and 256GB at the latest).
It consistently fails one of my own tests too, but PractRand fails splitxix33 more quickly.

Neat idea, having an implementation trivial to memorize but these constants don't quite work.

SplitMix64 does not have this behaviour.

cmdline_from_argv8: wrong handling of trailing backslash

Example 1:

> gcc -DDEMO -o demo.exe cmdline.c
> demo.exe "c:\program files\\"
cmd = demo.exe  "c:\program files\\"
argc = 2
argv[0] = demo.exe             (8) 64 65 6d 6f 2e 65 78 65
argv[1] = c:\program files\    (17) 63 3a 5c 70 72 6f 67 72 61 6d 20 66 69 6c 65 73 5c
recmd = demo.exe "c:\program files\"

Notice the recmd = line not having the last slash escaped, even though it appears before a closing quote.
If we execute that command as it appears above:

> demo.exe "c:\program files\"
cmd = demo.exe  "c:\program files\"
argc = 2
argv[0] = demo.exe             (8) 64 65 6d 6f 2e 65 78 65
argv[1] = c:\program files"    (17) 63 3a 5c 70 72 6f 67 72 61 6d 20 66 69 6c 65 73 22
recmd = demo.exe "c:\program files\""

We get a different result, because the arg is interpreted as having unclosed quotes with an escaped quote at the end.

Expected output for example 1 would have been:

> demo.exe "c:\program files\\"
...
recmd = demo.exe "c:\program files\\"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.