benzofuran

Joined 14 years ago

Karma
389
Submissions
107
Member since
Mar 7
Metallurgical Engineer
View on Hacker News

Recent submissions

Comment · 4 months ago
I'm stuck enough in the gecosystem that the storage is of small worry there but good point. It's a cute idea for the main topic - I saw some pictures I'd forgotten about for 20 years so that was fun.
Comment · 4 months ago
Here's a gmail extractor google apps script that does the same thing, but for not $30!

function autoExtractGmailMedia() { const START_TIME = Date.now(); const TIME_LIMIT = 1000 * 60 * 5; // 5 minutes (leaves a 1-minute safety buffer) const BATCH_SIZE = 50; const FOLDER_NAME = "Gmail_Media_Export";

  // 1. Retrieve our current position from the script's property store
  const scriptProperties = PropertiesService.getScriptProperties();
  let startIndex = parseInt(scriptProperties.getProperty('START_INDEX')) || 0;

  // Locate or create the destination folder
  let folder;
  const folders = DriveApp.getFoldersByName(FOLDER_NAME);
  if (folders.hasNext()) {
    folder = folders.next();
  } else {
    folder = DriveApp.createFolder(FOLDER_NAME);
  }

  // 2. Process batches in a loop
  // Updated search query to ignore USPS and non-primary tabs
  const searchQuery = 'has:attachment -from:usps.gov -category:promotions -category:updates -category:social (filename:jpg OR filename:jpeg OR filename:png OR filename:zip)';
  
  while (true) {
    const threads = GmailApp.search(searchQuery, startIndex, BATCH_SIZE);
    
    // If the search returns empty, we've hit the end of the inbox
    if (threads.length === 0) {
      console.log("Extraction completely finished.");
      scriptProperties.deleteProperty('START_INDEX');
      deleteTriggers(); // Clean up so it doesn't keep running
      return;
    }

    for (let i = 0; i < threads.length; i++) {
      const messages = threads[i].getMessages();
      for (let j = 0; j < messages.length; j++) {
        const attachments = messages[j].getAttachments();
        for (let k = 0; k < attachments.length; k++) {
          const attachment = attachments[k];
          const name = attachment.getName().toLowerCase();
          const type = attachment.getContentType();
          const size = attachment.getSize();
          
          // Apply size threshold (102,400 bytes = 100KB) and file type filter
          if (size > 102400) {
            if (type.includes('image/') || name.endsWith('.zip')) {
              folder.createFile(attachment);
            }
          }
        }
      }
    }

    // Increment our starting index for the next batch
    startIndex += BATCH_SIZE;

    // 3. The Stopwatch Check
    if (Date.now() - START_TIME > TIME_LIMIT) {
      console.log(`Approaching timeout at index ${startIndex}. Saving state and passing the baton...`);
      scriptProperties.setProperty('START_INDEX', startIndex.toString());
      scheduleNextRun();
      return; // Exit to avoid the hard timeout exception
    }
  }
}

function scheduleNextRun() { deleteTriggers(); // Prevent duplicate overlapping triggers ScriptApp.newTrigger("autoExtractGmailMedia") .timeBased() .after(60 * 1000) // Fire a new execution 1 minute from now .create(); }

function deleteTriggers() { const triggers = ScriptApp.getProjectTriggers(); for (let i = 0; i < triggers.length; i++) { if (triggers[i].getHandlerFunction() === "autoExtractGmailMedia") { ScriptApp.deleteTrigger(triggers[i]); } } }

Comment · 1 year ago
Sounds like plotjuggler (https://github.com/facontidavide/PlotJuggler) could be worth checking into as well for you.
Comment · 1 year ago
Bricscad (www.bricsys.com) is a professional (paid) cad package that has most of what you're looking for. They're old-school perpetual license folks and they have a fully featured demo so you can try out the various scripting/programmatic options for a bit. No relation except as a user, but if you're willing to pay it's probably your easiest path forward.
Comment · 2 years ago
If you're ever in Edinburgh, this is an excellent place to visit and spend an afternoon. One of the funniest parts was upon walking in the door, the gentleman who greeted me asked "What kind of engineer are you?" Very worthwhile.
Comment · 3 years ago
Awesome - getting KMZs of 4x4 routes is way harder than it should be. All the Colorado data is there but extracting it is challenging.
Comment · 3 years ago
Cool site! Any chance of a adding a simple KMZ export for offline use for a given area of interest?
Comment · 3 years ago
It's getting much tougher to pull this off - I recently had an offer for a cherry government job but it was in southern California. The salary, while competitive for most locations, would've required me to be independently wealthy to live within an hour of the office in order to buy even a modest home.
Comment · 3 years ago
Is this for software engineers or actual engineers? You may want to specify.
Comment · 3 years ago
Book list: https://www.goodreads.com/list/show/177152.Dan_Carlin_s_Hard...

For some reason it didn't get appended to the podcast descriptions

Comment · 3 years ago
Dan Carlin's Hardcore History (episode 1: https://www.dancarlin.com/product/hardcore-history-62-supern...) recently did a great series "Supernova in the East" on the modernization of Japan and the internal politics. If you've got some time (drive or such), it's well worth the listen and there's a great diversity of sources.
Comment · 3 years ago
They certainly haven't made this mistake in any late-model F-x50 Super Duties. The amount that has to be unplugged and shuffled to do even minor work is amazing, not to mention the entire front end has to be disassembled to replace the headlight bulbs.

Hopefully this will usher in some 'common sense' engineering at Ford and other manufacturers and get them back to sane and serviceable designs.

Comment · 3 years ago
Anybody seen similar hardware out of aluminum or coated steel or stainless that's also readily USA-available? Machining these could be done on a small lathe and single-sided CNC...
Comment · 4 years ago
seems to mostly just barf up partial wikipedia articles - big whoop
Comment · 4 years ago

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton