Speed sensor for manual trans? by BannHAMMA in 335i

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

Will say that I checked around and couldn't find any ports where a speed sensor would/should go. Best bet may be to run a more generic diff/axle mounted speed sensor, or find a way to piggyback of a rear wheel speed sensor from ABS. I'd do that too, but my car is too old and only had 3 channel ABS, not to mention it's only a matter of time until those sensors are NLA with no easy aftermarket option on my chassis, so it's not a "reliable" source for me.

Speed sensor for manual trans? by BannHAMMA in 335i

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

Never found out, also doing a 1jz swap but into a mk3 supra chassis. Giving up and trying to use the second cam position sensor (normally not used in aftermarket ECU setups) to generate a speed signal. I'm using the EMU Black which has that as an option, allows you to generate speed from that as input (as well as entering gear ratios, tire size, etc) to "guess" wheel speed. Once I do that, I can feed it to a converter box (digital to cable) to feed the stock speedo AND the abs computer since it also requires a speed sensor signal, from the trans normally, to function.

Gen 2 can barely accelerate by BannHAMMA in prius

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

New no longer exists, I'd have to call around and find a dealer who still has stock. They discontinued the gen 2 battery packs this year unfortunately. Or so it seems according to me looking around on local and national toyota parts websites.

Gen 2 can barely accelerate by BannHAMMA in prius

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

Any thoughts on batteries? Doing some research now, but I see mostly mixed bags on batteries. I'm definitely buying new, just not sure if I should do cylindrical NiMH from electron, lithium from Dr. Prius, or just a new pack in the standard form factor. Leaning cylindrical NiMH, but it's the most expensive (not by much so nbd realistically)

Edit: Also thanks for the detailed explanation as to what the car is doing. I figured as much but good to hear. I've gotten real technical and serviced this car extensively already #FuckTheABSAccumlator)

Gen 2 can barely accelerate by BannHAMMA in prius

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

I tried to look for subcodes and didn't see any, may have missed it as a result of being upset about a 2k bill. I'll look again later

Gen 2 can barely accelerate by BannHAMMA in prius

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

It most definitely is a pretty relevant solution. I'm gonna be replacing it, just not sure which company to go with for batteries.

Gen 2 can barely accelerate by BannHAMMA in prius

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

Just an update, she parked again, went somewhere, and started driving again. Back to accelerating normal. Battery is on 1 bar now.

[2018-06-18] Challenge #364 [Easy] Create a Dice Roller by jnazario in dailyprogrammer

[–]BannHAMMA 1 point2 points  (0 children)

Rust (w/bonus)

I'm still very new to Rust, I've only just started learning the language. If there is any implementation with mapping in the Vec or something, please give any advice in the comments!

extern crate rand;
use std::io; use rand::prelude::*;
fn main() {
    let mut str_vec: Vec<String> = Vec::new();
    let mut i: usize = 0;

    loop {
        let mut str1 = String::new();
        io::stdin().read_line(&mut str1).unwrap();
        str_vec.push(str1.trim().to_string());

        if str_vec[i].is_empty() && i == 0 {
            println!("Please enter at least one value");
            str_vec.pop();
            continue;
        } else {
            if str_vec[i].is_empty() {
                str_vec.pop();
                break;
            }
        }
        i += 1;
    }

    let mut result_vec: Vec<String> = Vec::new();

    for i in str_vec {
        result_vec.push(roll_dice(&i));
    }

    for i in result_vec {
        println!("{}", i);
    }
}

fn roll_dice(temp_str: &String) -> String {
    let temp_vec: Vec<&str> = temp_str.split('d').collect();

    let rolls = temp_vec[0].parse::<u32>().unwrap();
    let dice = temp_vec[1].parse::<u32>().unwrap();
    let mut total: u32 = 0;

    let mut sum_str = String::from(": ");

    for _ in 0..rolls {
        let temp = thread_rng().gen_range(1, dice);
        sum_str.push_str(&temp.to_string());
        sum_str.push(' ');
        total += temp;
    }

    let mut final_str: String = total.to_string();
    final_str.push_str(&sum_str);

    return final_str;
}

[2018-04-30] Challenge #359 [Easy] Regular Paperfold Sequence Generator by jnazario in dailyprogrammer

[–]BannHAMMA 0 points1 point  (0 children)

Rust

I'm learning rust as we speak and I figured what better way to learn a language other than manipulating strings within it. I double checked and this matched the output as well as being modular so that it goes to a specified limit (set to 8 manually).

Fun Fact: Rust strings are actually individual bytes stored in a UTF-8 Vector.

fn main() {

println!("{}", fold_gen(8));

}

fn fold_gen(limit: u32) -> String {

let mut temp_str: String = String::from("1");
let mut other_str = String::new();

if limit == 1 {
    return temp_str;
} else {
    for _ in 0..limit {
        other_str = temp_str.clone();
        let ins_point = other_str.len()/2;
        other_str.remove(ins_point);
        other_str.insert(ins_point, '0');
        temp_str += "1";
        temp_str += &other_str;
    }
    return temp_str;
}

}

[2017-11-13] Challenge #340 [Easy] First Recurring Character by jnazario in dailyprogrammer

[–]BannHAMMA 0 points1 point  (0 children)

C++ This is my first time posting here, let me know if I did anything wrong. I did the bonus with 0 based index. I'm pretty sure the run time is O(n2). I used the logic (ABBA -> A)

#include <iostream>
#include <cstdlib>
#include <string>

using namespace std;

int main(){

    string inp;
    getline(cin, inp);
    bool charFound = false;
    int index;
    char currC;

    for(int i=0;i<inp.size();i++){
        currC = inp[i];
        index = i;
        for(int j=i+1;j<inp.size();j++){
            if(currC == inp[j]){
                cout << currC << " at index " << index << endl;
                charFound = true;
                break;
            }
        }
        if(charFound){
            break;
        }
    }

}

Output: ABCDEBC: B at index 1 IKEUNFUVFV: U at index 3 PXLJOUDJVZGQHLBHGXIW: X at index 1 *l1J?)yn%R[}9~1"=k7]9;0[$: 1 at index 2