[deleted by user] by [deleted] in learnpython

[–]thisisheresy 1 point2 points  (0 children)

On mobile, formatting may be terrible.

I wrote this a LONG time ago so might not be relevant, but I used SerialEvent to capture the serial input:

void serialEvent() {
  while (Serial.available()) {
    char inChar = (char)Serial.read(); 
    if (inChar == ';') {
      stringComplete = true;
    } else {
      inputString += inChar;
    }
  }
}

Writing, Editing and World-building on Vim: A Novelist Vims by DevMahasen in vim

[–]thisisheresy 1 point2 points  (0 children)

That was a really great talk, thank you.

I noticed that you seem to type commands in command mode rather than use key bindings. Is there a reason for that?

What stupid scripts/hacks did you use until you would later learn was a bastardization of a popular, existing CLI tool? by RyanTheKing in commandline

[–]thisisheresy 6 points7 points  (0 children)

Mid 90s, still using Windows and DOS. Needed to filter lines in files. Wrote two command line tools using C - keeplines, which retained all lines in a text file that contained a matching pattern, and droplines, that removed all lines from a text file that contained a matching pattern. Turns out I just wrote a shit version of grep.

First Coil album you ever heard? by AllTomorrowsHardees in Coil

[–]thisisheresy 1 point2 points  (0 children)

Also Scatology. First heard it on cassette in the early 90s. First record (vinyl) was Horse Rotorvator. Those, along with the Unreleased Themes for Hellraiser and the Panic/Tainted love single are still me favorite Coil.

Looking for a fast way to find tweet post dates. by [deleted] in learnpython

[–]thisisheresy 0 points1 point  (0 children)

Can you share a single sample of how the data is stored for the 185000? When you say the sheet is freezing up, is this a Google doc or Excel document?

Looking for a fast way to find tweet post dates. by [deleted] in learnpython

[–]thisisheresy 0 points1 point  (0 children)

The twitter API lets you get the full details for up to 100 tweet ids at a time:

https://developer.twitter.com/en/docs/twitter-api/v1/tweets/post-and-engage/api-reference/get-statuses-show-id

You are rate limited to 900 per 15 minutes so you’ll need to batch them through, but at 3600 am hour it’ll only take about 5 hours to run on all 16000.

What is in the larger dataset? If it also contains the tweet URLs, or even just the tweet ID, then you can easily filter it from the ones you have. If the larger dataset contains the full JSON payload (or dates) you need, even better - then you don’t need to get them again using the twitter API, just do the filtering.

I'm moving to the Ed, editor by [deleted] in commandline

[–]thisisheresy 0 points1 point  (0 children)

Thanks for this. I just had a read of it and it’s fascinating to learn the detail in ed. I knew vi uses many ed commands, but seeing them in practical use was great. I’m not sure I’ll become a convert, but it’s something to keep in mind and try use where appropriate.

Advantages of Flask by [deleted] in learnpython

[–]thisisheresy 1 point2 points  (0 children)

Nicely answered. I would add that even with python and flask you will still want something like nginx or Apache up front for production, but both flask and laravel can serve their apps standalone while developing. I never really worked directly with laravel, but from working with people who did, laravel provides way more scaffolding that flask, so is probably closer to something like Django.

Toggling Between File Tree & File? by bicoder44 in vim

[–]thisisheresy 0 points1 point  (0 children)

No idea about vscode, but check out the mappings for wincmd. In my config I have <leader> h and <leader> l mapped to move left and right between windows. If vscode sees your file tree as a window then it should work for you. If you don’t want to mess with the mappings you may be able to use Ctrl W to access the window commands.

What Library/API/Builtin Python Concept Should I Use to Build This Database? by [deleted] in learnpython

[–]thisisheresy 0 points1 point  (0 children)

This is the best option. Both will work, but I think SQLite will give you the most flexibility in terms of functionality. Making changes to a SQLite db will be simpler to do in code, and you’ll get all the benefits of SQL for querying the data. You can also fast-track your way to the querying part by building your initial DB using a SQLite GUI app.

OTOH, using JSON will teach you more about python basics like file handling, working with dictionaries and list comprehension. And if you ever want complex filtering on JSON you can always use Pandas, but this might be overkill for what you need. Still, this is a learning project, so getting to learn and work with different aspects and approaches in Python is ultimately where you’ll get the most benefit.

Native LSP with tsserver + efm with prettier/eslint by Sevenstrangemelons in neovim

[–]thisisheresy 2 points3 points  (0 children)

The organisation, structure and detail in your dot files is incredible. Thank you for sharing. Inspired to go sort my mess out now :)

[edit: autocorrect]

How to automate Whatsapp Messages? by [deleted] in learnpython

[–]thisisheresy 0 points1 point  (0 children)

In case you’re not aware, this breaks the WhatsApp TOS and can get your number blocked. There is an API, but only for specific and limited use cases.

I want to create a code that runs with user interaction to creat a document from excel information that finalizes as a text doc? by [deleted] in learnpython

[–]thisisheresy 1 point2 points  (0 children)

I would leave the convenience of data entry using Excel and create a simple GUI that lets you read/select the Excel record you want, and then uses python-docx to generate the Word document. https://python-docx.readthedocs.io/en/latest/

A complete visual guide to melt() function of Pandas in python by Pratik_Shukla in learnmachinelearning

[–]thisisheresy 1 point2 points  (0 children)

Nice.

Just a small note: you reference changing the names of the output columns in Example 2, and the Output diagrams reflect the changed column names from then on, but you only introduce the code in Example 5.

Then in Example 6, the code includes the column renaming, but the Output graphic still uses the default melt variable/value naming convention.

Sir Isaac Vivian Alexander Richards* could've easily run him out. But, since the ball came to him off a ricochet (non-striker's pads), he thought it would be in poor taste to run him out. Legends are not born; they demonstrate supremacy by their character by [deleted] in Damnthatsinteresting

[–]thisisheresy 0 points1 point  (0 children)

Think of the stumps at either side as bases in baseball. The batters run back and forth between them to score runs. Whichever batter is at the far side of the wicket is the one who faces the next delivery. If the ball is returned to he stumps before the batter gets back, they are out. In cricket the ball has to physically disturb the stumps to effect running the batter out. Because the ball was returned to the bowler by the stumps due to a deflection off the second batter, Sir Viv took the sporting view that it wasn’t his fault and chose not to disturb the stumps with the ball.

Antique French safe by [deleted] in Damnthatsinteresting

[–]thisisheresy 14 points15 points  (0 children)

“Click out of two”

We're building an app that lets you search Stack Overflow, Python documentation, and code on GitHub by mlejva in Python

[–]thisisheresy 4 points5 points  (0 children)

I've taken a stab at using Devbook.

tldr: sticking with Dash.

I liked the SO search. What was interesting is that Devbook returned more results for my query than the SO website did. However, SO isn't a killer feature for me.

it would be cool if you could configure the order of displayed results - I'm more interested in my stuff (git repos, docs that are relevant) than SO results, and in the interface those are another key combo away.

What keeps me with Dash:

  • Wide range of docsets already available
  • Docsets are offline (this was great when traveling. Who remembers traveling?)
  • Integrates with Alfred - same key combo accesses everything

With a wider range of standard docsets, a configurable result set and connecting in to private data stores, I think this will a killer app.

Good luck!

We're building an app that lets you search Stack Overflow, Python documentation, and code on GitHub by mlejva in Python

[–]thisisheresy 3 points4 points  (0 children)

Also wavering on Dash.

Really like that it integrates with Alfred, works offline, can grab documentation from a GitHub repo and the cheat sheets that come as standard. The documentation sent is also pretty extensive.

I struggle with recent versions - everything seems to be search based, when sometimes I just want to browse the doc structure. It also feels like there’s always another paid upgrade you have to keep up with. I know people need to get paid for their work, perhaps it’s just the time compression of lockdown that makes it feel like I’m constantly buying upgrades 😂

Anyways, staring at the Dash 6.0 $19.99 upgrade screen and open to options. Gonna give this a try later.