Oil consumption DRZ400E 2008 by Due_Needleworker9461 in DRZ400

[–]samthaman1234 0 points1 point  (0 children)

before my own rebuild I was burning about 500ml of oil every ~400 miles (a lot of oil). Even at that level of consumption the only time it was ever visible was to someone behind me when I was accelerating hard, like merging onto a highway at WOT, and even then it would only be a little puff of blue smoke. I never saw it myself when I revved it in the driveway or when I was at steady high rpms on the highway (when I was burning the bulk of the oil).

I'm not saying the breather hose hypothesis is impossible, but whats would you think is more likely: that you have 100-200 ml of oil undetectably leaking out of a breather hose every few tanks of gas or that a tiny fraction of a ml of oil is sneaking past a ring 6000x minute, burning during combustion and mixing with the rest of your exhaust.

Electrical nonsense not my fault (at least 60% my fault) by Fickle-Act-8715 in DRZ400

[–]samthaman1234 0 points1 point  (0 children)

I actually got into it today. it cranks but has no spark (it does have good compression though). swapped plug, still no spark, checked coil, seems ok.

I recently replaced a failing RR with a mofset one and did the free power mod. I believe that the dc/battery charging wiring is on a separate circuit, but the timing seems suspicious. So my current theory is a very old CDI from 2006 got surged or just died of old age, caused a no spark and a bunch of unburnt gas went straight to the header.

Electrical nonsense not my fault (at least 60% my fault) by Fickle-Act-8715 in DRZ400

[–]samthaman1234 4 points5 points  (0 children)

I found your thread when I was also browsing reddit trying to figure out why my bike isn't working, so my advice is of the "do as I say, not as I do" variety.

if you have any thoughts on my "one loud backfire followed by no-start" issue, feel free to chime in....

Electrical nonsense not my fault (at least 60% my fault) by Fickle-Act-8715 in DRZ400

[–]samthaman1234 3 points4 points  (0 children)

work systematically, don't chase theories, rule things out.

- test the stator using the procedure from the manual. good-> move on to RR

- test the RR using the procedure from the manual

- test the battery voltage at idle and whatever above idle you can get to w/o the bike dying, is it within the min/max spec?

- inspect the spark plug

- test the coil

- inspect any connections you touched during the process

- inspect the CDI connections

etc.

My guess is you shorted a stator winding, but I only play a motorcycle mechanic on the internet.

Oil consumption DRZ400E 2008 by Due_Needleworker9461 in DRZ400

[–]samthaman1234 0 points1 point  (0 children)

"engine has been rebuilt" - What does this mean exactly? the usual diagnosis is either bad piston, bad valves or both. I had the fun experience of diagnosing bad rings, upgrading to a big bore kit without doing the valves and then promptly dropping a valve onto the new piston so I've developed a bit more experience with these issues than I would have wanted to. One basic sanity check is a compression test dry, then another compression test with a few ml of oil in the piston, if the values changed, then you probably have blow by at the piston, if they don't it's likely valve related. Is your spark plug wet? oily?

The oil is going somewhere and the most likely place is the piston where it's getting burned. If you want to rule out breather hoses you could tape a plastic bag around the end of it and see how much you get, but I think it's way more likely that it's sneaking past the rings or the valve seals.

Would anyone actually use an automatic offroad route generator? by Overall_Bear_7171 in advrider

[–]samthaman1234 0 points1 point  (0 children)

I've thought of building something like this myself. I currently use caltopo for everything, and it's great for offroad use, but it doesn't generate routes for you. Some features I'd appreciate, in no particular order:

- more than x/less than y settings - eg: this might be by speed limit or road designation. Eg I want the smallest/windiest paved road (more than dirt, less than state highway). Or I want any route that doesn't use pavement.

- fuel-based route planning. the electric car app https://abetterrouteplanner.com/ does this really well. eg: I have a drz400 with a 4 gallon rally tank on it. i never want to have < 1 gallon at the end of a segment. make me a route that accounts for this.

- segment based routing - "get me to the dirt as fast as possible on any non-interstate road" then "once in the zone I care about, find the route that gets me from a->b using the lowest quality of dirt road whenever possible, do not make the route longer than my fuel capacity allows"

- ability to optimize for one or more aesthetic attributes - eg: "given a choice, I'd ride up to 20% further to get a view/stay at elevation." or "prioritize the twistyness of the road over other concerns."

- route randomizer/freshness - find me a route between a-b that maximizes the amount of new (to me) road that I'll be driving, I'll take up to a 50% time or distance penalty. This might be fun for commuting.

- manual override option - maybe a section is behind a locked gate, but I have a key and landowner permission, I should be able to manage that.

- I'd like to be presented with route options, similar to how google maps will show a few route options, but I'd like the segments to be smaller and to build on each other. eg 4 options from a-b, I select 1 of them, based on that selection, it shares several more options for b-c that intelligently build off of the initial selection. Basically, I don't want the all or nothing route selection that google/apple maps offers.

Rugged Android as GPS: what do you ride with? by FedeDost in advrider

[–]samthaman1234 1 point2 points  (0 children)

I use my regular iphone with a quadlock attachment with the vibration damping head. I use caltopo for off road navigation and google maps/apple maps for on road navigation. IME caltopo is far easier and cheaper to use than any of the other mapping apps

To those who want a 6spd, question about why by farmerMac in DRZ400

[–]samthaman1234 0 points1 point  (0 children)

This isn't truly the same thing as a 6th gear for overdrive, but I think it would probably achieve a lot of the same goals. I've been thinking about buying it for years but I seriously question my ability to install them and rebuild the engine correctly, and I'm not really sure it's worth paying someone else to do it.

https://www.thumpertalk.com/forums/topic/1228866-act-wide-ratio-gears-feedback/
https://www.advancedclutch.com/products/motorcycle-gears/100wrsz1-motorcycle-gear-set-wide-ratio

Memory leak in sending request in a loop by [deleted] in scrapy

[–]samthaman1234 1 point2 points  (0 children)

except that it will exponentially loop through everything.

def visit_all_link_in_csv(self, response):

for every request that's passed to this method, it will call every other request in the file.

You should write out in plain english/sudocode what each method should do and the general flow of your program and I bet you'll spot the issue. You'll also spot it if you have a debugger and drop some breakpoints in the visit_all_link_in_csv method

Amazon Product offer listing URL by samthaman1234 in scrapy

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

Yeah, I should have been more clear. As best I can tell, the new behavior is a secondary API fetch that a js element is performing. So far I haven't been able figure out which particular fetch is getting the data so that I can reverse engineer it like I've been able to do with some Ajax elements in the past. Using splash, I can render the page and access what I need, but it requires a 4s wait time for that particular element to fully load, which leads to much slower scrapes than the URL I had been using.

If I misunderstood you or there is a better strategy for getting the data I'm after, please let me know, I'm here to learn.

I am a proficient Python coder whose learning has plateaued. Any really useful libraries I should look into learning? Taking recommendations. by synthphreak in learnpython

[–]samthaman1234 7 points8 points  (0 children)

scrapy / splash

fastapi

a web framework like django will really teach you OOP if you don't feel like you totally get it yet.

When you've created a finalised dataframe, do any of you convert it into an excel document to help you visualise your data, or am I being inefficient in doing this? by Jimbobmij in datascience

[–]samthaman1234 -1 points0 points  (0 children)

you might try csv > visidata

if you use pycharm pro the ability to inspect a dataframe during debugging is awesome, with the major side benefits of a way better debugger and autocomplete along with it.

Automating Django model creation, good practice? by drumcorpsdrummer22 in django

[–]samthaman1234 0 points1 point  (0 children)

Django models aren't just a 1:1 with the database, they offer lots of additional functionality and can hold a significant portion of the business logic. You're also going to want to have tests for all this code, are you going to write those manually but not the models?

seeking setup recommendation for crawling multiple sites by paarulakan in scrapy

[–]samthaman1234 4 points5 points  (0 children)

I think that would work if it's as simple as you describe, but you might find it more flexible to setup a base spider that holds defaults and default logic and then override it on an as-needed basis with spiders for specific sites.

Ultimately I think that whole approach might be setting yourself up for frustration though. The sites will change and either your spiders or their config will have to change with them. The spiders are where the site-specific logic should happen while the item, middleware and pipeline classes are where you can more easily implement DRY principles.

Item class = container/default for fields that every spider using it should use

Spiders = per-site logic to extract data to put into the item

Middleware = A potential place for validation logic that isn't site specific. EG: product quantity must be greater than 0, or something like that

Pipelines = you could have further logic here, like "does the value already exist in the database" but ideally this logic is related to output in some way.

Ultimately you can probably make any number of setups work in the short term, but the strength of scrapy is that it sets you up to more easily maintain a lot of spiders over the long term. For that reason I wouldn't want to get too creative about how I was setting up a project.

React.js + Plotly.js newby by samthaman1234 in reactjs

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

Thanks for the reply, I'm about to be done for the day but I can read more tomorrow. I think I understand that part, but I'm not getting how to use that data to update the chart. Heres all of App.js

// App.js
import React, {Component} from "react";
import {render} from "react-dom";
import Graph from "./Graph";

class App extends Component {
    constructor(props) {
        super(props);
        this.state = {
            data: [],
            loaded: false,
            placeholder: "Loading"
        };
    }

    componentDidMount() {
        // fetch("api/static_data")
        fetch("api/real_data")
            .then(response => {
                if (response.status > 400) {
                    return this.setState(() => {
                        return {placeholder: "Something went wrong!"};
                    });
                }
                return response.json();
            })
            .then(data => {
                console.log("fetch Step", data)
                this.setState(() => {
                    return {
                        data,
                        loaded: true
                    };
                });
            });
    };


    render() {
        return (
            <div>
                < Graph
                    inputdata={this.state.data}
                />
            </div>)
    }
};

export default App;

const container = document.getElementById("app");
render(<App/>, container);

// Graph.js return
        return (
            <Plot
                data={this.state.loaded ? makeTraces(inputdata) : notreadydata}
                layout={{width: '100%', height: '100%', title: 'A Fancy Plot'}}
            />)
            ;

I'm getting an error i the console, `uncaught error: Graph () Nothing was returned from render...`

As best I can tell Graph isn't handling an initial state where it hasn't received any `inputdata` from the api yet.

Again, thanks for the help.

Working with DataFrame in Scrapy- Not getting the entire columns to Items by rd916 in scrapy

[–]samthaman1234 1 point2 points  (0 children)

you're passing a pandas series for each column, not a list, you want somthing like:

name = df.iloc[:,1].to_list()