Code Monkey home page Code Monkey logo

doiwannaknow's People

Contributors

flarp avatar

Watchers

 avatar  avatar

doiwannaknow's Issues

Fix form len

Just realized that the form length stuff is now incorrect due to input being a string and not a vector of strings.

Replace JSON with i32's for posting opinion charts

// instead of using a vector of booleans, use two i32's
#[derive(FromData)]
struct lol {
  thing: [i32; 2]
  /* ... */
}

#[derive(FromData)]
struct password { write_pass: i32 }

// have the password as a URL parameter
#[post("/opinion_post?<password>")]
fn thing(dunno: lol, pass: password) -> TemplateResponder {
  if (pass is wrong) { Err("go away") }
  let mut num: i64 = 0;
  num |= dunno.thing[0];
  num <<= 32;
  num |= dunno.thing[1];
  // probably much faster than JSON parsing.
}

Replace using byte iterators in parse_bytes to using 9 byte buffer

// bytes.read returns how many bytes were read into the buffer
// only 8 should be read in, nothing more and nothing less
// the buffer is 9 bytes so we can know if the request is longer than 8 bytes
let mut buffer: [u8; 9];
if bytes.read(&buffer) != 8 {
  return Err(DIWKError::InvalidRequestLength);
} else {
  // do stuff
}

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.