HNHacker News
TopNewBestAskShowJobs

counttheforks

884 karma · joined September 28, 2022

submissionscomments
counttheforks··on I was banned because of a security flaw in Facebook’s password recovery system
Reddit is worse. They will just flat out ignore you.

HN isn't much better. I've emailed them asking for my data to be removed, as is my right as an EU citizen and dang simply refused saying it wouldn't be fair to other users. As if that overrides the law.

counttheforks··on Supabase Clippy – ChatGPT for Supabase Docs
> Want to try it out? It's a hidden feature while in MVP - visit supabase.com/docs and hit cmd + / to pull up the search box (sorry mobile users).

My keyboard does not have a cmd key, and I am not a mobile user.

counttheforks··on The Untold Story of SQLite (2021)
> You both asked for and complained about being given a reason why the article is a dupe. Which is it?

Dang posted the links to the previous stories, didn't mark the post as a dupe or say anything about it being a dupe. Because it's not. Then two hours later it silently got deleted.

counttheforks··on Domain Registry Takes Sci-Hub’s .SE Domain Name Offline
What is this referencing? Just ChatGPT et al illegally slurping up everything they can get their hands on, or something more specific?
counttheforks··on The Untold Story of SQLite (2021)
A dupe of 3 and 4 day old posts, which got nearly 200 comments? No. It is not reasonable to just remove that. This is censorship. Especially when you consider that dang tends to instead just post a comment saying: "Previously discussed at ..."

> I do not understand how this post is number one. Are you saying Hacker News can promote certain posts to the top and it is not organically curated?

Absolutely, yes. The mods can influence the ranking directly and they have openly talked about this. If you search https://hn.algolia.com/ for "penalized", "demoted" or "promoted" you will find discussions regarding this.

---

Since dang banned me from posting new replies:

> Maybe you haven’t been here long enough to have read the FAQ or know that generally all dupes from 3-4 days ago are marked, and only allowed after at least several months?

I've been here for many years. I just make a new account periodically. Maybe you haven't been paying enough attention to see the difference in behavior that dang exhibits when he wants to censor something? Notice how he's usually all over the comments explaining why something was removed as dupe, but now there is nothing except him linking to the older posts (https://news.ycombinator.com/item?id=34559614), waiting for an hour or two, and then silently deleting the new one.

Not to mention that the subject of the post is completely different. The latest post is about the documentary being removed from archive.org at the request of the BBC. None of the earlier posts cover this.

counttheforks··on BBC Modi Documentary Removal
@dang why did this get demoted off the front page? You claim it's a dupe, but this is a lie. No other posts discussing this are on the front page.
counttheforks··on Show HN: YouTube Summaries Using GPT
No payment limits?
counttheforks··on Passenger Uses AirTags, Discovers Airline Donated Their Bags to Charity
So blame airlines for not being trustworthy & not providing enough space, not the people doing the only sane thing they can to deal with it.
counttheforks··on Google is screwed, even if it wins its antitrust case
Are we ignoring that ChatGPT is stuck in the past and that continuously retraining it on current data is currently still prohibitively expensive?
counttheforks··on An IP attorney’s reading of the Stable Diffusion class action lawsuit
The models are already released. They can't retroactively censor released models.
counttheforks··on An IP attorney’s reading of the Stable Diffusion class action lawsuit
> If the image is freely viewable (say you can browse to it)

This doesn't mean anything. If an unsecured SSH server is connected to the internet that lets anyone who connects to it in and gives them a root shell, it is still illegal to 'hack' that machine. The law cares about intent, not technicalities.

edit: Since HN decided to break with "You're posting too fast. Please slow down. Thanks." again, banning me from replying: This is obviously just an example intended to show that the law cares more about intent than technical measures.

@dang Calm down dude.

counttheforks··on Smart ovens shouting out to servers in Russia and China
I'm sure they'll just throw error messages until they've managed to establish a connection. Device manufacturers have already shown they'd rather cripple your devices than respect your wishes.
counttheforks··on Smart ovens shouting out to servers in Russia and China
They're actually making their money from negligence. If you plan to sell an internet connected device you better be prepared to to put care and effort into designing & maintaining it.
counttheforks··on Replacing a SQL analyst with 26 recursive GPT prompts
Then you're very much misinformed.

> my assistant does my bidding

It doesn't. Try asking it how to make a bomb, then search for the same on youtube. One of the two yields a useful result, the other gives a moralistic lecture.

counttheforks··on Ask HN: What are we even chasing?
bugs
counttheforks··on KeenType: Pure Java typesetting system
> There was a missing import

Oops :)

When pressing Ctrl+Enter, did you see the green "Loaded!" notification in the bottom right? If so, then I guess installing the Kotlin plugin worked.

> Opening the menu with Ctrl+Shift+A doesn't show the bulk refactor script

The Ctrl+Shift+A menu from the default keymap that I'm talking about is the "Actions" dialog. You can also get there via "Navigate -> Search Everywhere" and then selecting the "Actions" tab (or just searching in All).

Also you only have to select a single folder/package and it will be processed recursively. I did not test what happens when you select multiple folders. Might be fine, might explode.

edit: Just realized the script I pasted here does not emit the "Loaded!" log message on load. So disregard those comments. If you want to verify it loads correctly, add this as the last line:

    log("Loaded!")
edit: HN rate limited my account again, so I'm not allowed to post any new comments for the next few hours. Good luck!

If you do wind up using this script and want to modify it, it is helpful to read https://plugins.jetbrains.com/docs/intellij/psi.html & to install the PsiViewer plugin from the marketplace.

counttheforks··on KeenType: Pure Java typesetting system
Make sure you pick Kotlin for the scripting language, not Groovy.

Then run the script like this:

1. In IDEA: Tools -> IDE Scripting Console -> Kotlin

2. Paste in the script

3. Ctrl+A, Ctrl+Enter to load the script. This should show a green "Loaded!" notification

4. Select a folder containing the classes in the Project window

5. Press Ctrl+Shift+A to open action menu

6. Search for Bulk refactor and select it

Also please note the first version of the script had a bug that would open confirmation dialogues for some refactorings, so see the edited script.

counttheforks··on KeenType: Pure Java typesetting system
Posted a solution on your other comment: https://news.ycombinator.com/item?id=34493760
counttheforks··on KeenType: Pure Java typesetting system
If you're fine using intellij then you can probably use its scripting to do this. It has access to most of the same API as plugins and can access intellij features such as its refactor rename.

The (meager) docs on scripting: https://www.jetbrains.com/help/idea/ide-scripting-console.ht.... The plugin docs & intellij source code (especially the unit tests) are a better source of information.

And here's a script that will use intellij's refactoring to rename all classes recursively in a directory to add the prefix Renamed, correctly dealing with references & renaming files if necessary:

  @file:Suppress("NAME_SHADOWING")

  import com.intellij.notification.Notification
  import com.intellij.notification.NotificationType
  import com.intellij.notification.Notifications
  import com.intellij.openapi.actionSystem.*
  import com.intellij.openapi.keymap.KeymapManager
  import com.intellij.openapi.command.WriteCommandAction
  import com.intellij.psi.*
  import com.intellij.psi.search.*
  import com.intellij.refactoring.rename.RenameProcessor
  import com.intellij.util.ThrowableConsumer
  import java.io.PrintWriter
  import java.io.StringWriter
  import javax.swing.KeyStroke

  // Usage: In IDEA: Tools -> IDE Scripting Console -> Kotlin
  // Ctrl+A, Ctrl+Enter to run the script
  // Select folder containing target classes, Ctrl+Shift+A to open action menu, search for Bulk refactor

  //<editor-fold desc="Boilerplate">
  val b = bindings as Map<*, *>
  val IDE = b["IDE"] as com.intellij.ide.script.IDE

  fun registerAction(
    name: String,
    keyBind: String? = null,
    consumer: ThrowableConsumer<AnActionEvent, Throwable>
  ) {
    registerAction(name, keyBind, object : AnAction() {
      override fun actionPerformed(event: AnActionEvent) {
        try {
          consumer.consume(event);
        } catch (t: Throwable) {
          val sw = StringWriter()
          t.printStackTrace(PrintWriter(sw))
          log("Exception in action $name: $t\n\n\n$sw", NotificationType.ERROR)
          throw t
        }
      }
    });
  }

  fun registerAction(name: String, keyBind: String? = null, action: AnAction) {
    action.templatePresentation.text = name;
    action.templatePresentation.description = name;

    KeymapManager.getInstance().activeKeymap.removeAllActionShortcuts(name);
    ActionManager.getInstance().unregisterAction(name);
    ActionManager.getInstance().registerAction(name, action);

    if (keyBind != null) {
      KeymapManager.getInstance().activeKeymap.addShortcut(
        name,
        KeyboardShortcut(KeyStroke.getKeyStroke(keyBind), null)
      );
    }
  }

  fun log(msg: String, notificationType: NotificationType = NotificationType.INFORMATION) {
    log("Scripted Action", msg, notificationType)
  }

  fun log(
    title: String,
    msg: String,
    notificationType: NotificationType = NotificationType.INFORMATION
  ) {
    Notifications.Bus.notify(
      Notification(
        "scriptedAction",
        title,
        msg,
        notificationType
      )
    )
  }
  //</editor-fold>

  registerAction("Bulk refactor") lambda@{ event ->
    val project = event.project ?: return@lambda;
    val psiElement = event.getData(LangDataKeys.PSI_ELEMENT) ?: return@lambda

    log("Bulk refactor for: $psiElement")

    WriteCommandAction.writeCommandAction(event.project).withGlobalUndo().run<Throwable> {
      psiElement.accept(object : PsiRecursiveElementWalkingVisitor() {
        override fun visitElement(element: PsiElement) {
          super.visitElement(element);
          if (element !is PsiClass) {
            return
          }

          if(element.name?.startsWith("Renamed") == false) {
            log("Renaming $element")

            // arg4 = isSearchInComments
            // arg5 = isSearchTextOccurrences
            val processor = object : RenameProcessor(project, element, "Renamed" + element.name, false, false) {
              override fun isPreviewUsages(usages: Array<out UsageInfo>): Boolean {
                return false
              }
            }
  
            processor.run()
          }
        }
      })
    }
  }
If your project is large this will temporarily freeze intellij since it doesn't properly run on the background thread but just give it a minute.

By the way, this should work on all languages that IntelliJ has a language plugin for, not just Java.

Edit: Modified script to override isPreviewUsages to prevent intellij from opening confirmation dialogs

counttheforks··on Git-sim: Visually simulate Git operations in your own repos
Not sure what you're going on about. I tried replicating what you describe, but `git switch` keeps working just fine.

    ~/tmp/foo git init repo1
    Initialized empty Git repository in /home/user/tmp/foo/repo1/.git/
    ~/tmp/foo cd repo1
    tmp/foo/repo1 ‹master› echo hi > hi
    tmp/foo/repo1 ‹master› git add hi
    tmp/foo/repo1 ‹master*› git commit -m hi
    [master (root-commit) d0cf572] hi
    1 file changed, 1 insertion(+)
    create mode 100644 hi
    tmp/foo/repo1 ‹master› cd ..
    ~/tmp/foo git clone repo1 repo2
    Cloning into 'repo2'...
    done.
    ~/tmp/foo cd repo1
    tmp/foo/repo1 ‹master› echo hi2 > hi 
    tmp/foo/repo1 ‹master*› git add hi
    tmp/foo/repo1 ‹master*› git commit -m hi2
    [master 3a82bdc] hi2
    1 file changed, 1 insertion(+), 1 deletion(-)
    tmp/foo/repo1 ‹master› git checkout -b someotherbranch
    Switched to a new branch 'someotherbranch'
    tmp/foo/repo1 ‹someotherbranch› git 
    tmp/foo/repo1 ‹someotherbranch› echo otherchange > otherchange
    tmp/foo/repo1 ‹someotherbranch› git add otherchange 
    tmp/foo/repo1 ‹someotherbranch*› git commit -m "otherchange"
    [someotherbranch 99ec880] otherchange
    1 file changed, 1 insertion(+)
    create mode 100644 otherchange
    tmp/foo/repo1 ‹someotherbranch› cd ../repo2
    tmp/foo/repo2 ‹master› git remote add upstream ../repo1 
    tmp/foo/repo2 ‹master› git fetch upstream
    remote: Enumerating objects: 8, done.
    remote: Counting objects: 100% (8/8), done.
    remote: Compressing objects: 100% (3/3), done.
    remote: Total 6 (delta 0), reused 0 (delta 0), pack-reused 0
    Unpacking objects: 100% (6/6), 448 bytes | 448.00 KiB/s, done.
    From ../repo1
    * [new branch]      master          -> upstream/master
    * [new branch]      someotherbranch -> upstream/someotherbranch
    tmp/foo/repo2 ‹master› git checkout master
    Already on 'master'
    Your branch is up to date with 'origin/master'.
    tmp/foo/repo2 ‹master› git rebase upstream/master
    Successfully rebased and updated refs/heads/master.
    tmp/foo/repo2 ‹master› git switch someotherbranch
    branch 'someotherbranch' set up to track 'upstream/someotherbranch'.
    Switched to a new branch 'someotherbranch'
counttheforks··on Git-sim: Visually simulate Git operations in your own repos
Speak for yourself.
counttheforks··on Git-sim: Visually simulate Git operations in your own repos
Practically speaking, anything mainstream that I actually use. And the "still" qualifier there is the problem. That number should be growing, not shrinking.
counttheforks··on Git-sim: Visually simulate Git operations in your own repos
I'd hope developers learning Git are a little more capable than literal children.
counttheforks··on Git-sim: Visually simulate Git operations in your own repos
Can you learn material sciences in an afternoon of minimal effort?
counttheforks··on Git-sim: Visually simulate Git operations in your own repos
No, it doesn't. It does make learning it practical considering it's what everyone uses.

If you think you can do better, please do! Let me know when you've gotten a few projects to switch over and I'll gladly learn that, too. Not a lot of projects using mercurial these days.

counttheforks··on Git-sim: Visually simulate Git operations in your own repos
Yes, we all know it has some rough edges and could be more convenient. Unless someone actually makes that idyllic more convenient tool and it becomes widespread, none of that matters. We're stuck with the hammer that everyone else is using. No sense refusing to learn how to use it just because you're stubborn, everyone else managed just fine.
counttheforks··on Git-sim: Visually simulate Git operations in your own repos
Terrible advice, you should absolutely start with the official UI, which is the CLI. Avoiding it because "it's hard" will just complicate everything down the line.
counttheforks··on Git-sim: Visually simulate Git operations in your own repos
You can either learn the tools of the trade, or you can go online and complain about how your hammer is too hard to use and so you refuse to hold it right. How is that not complaining?
counttheforks··on Git-sim: Visually simulate Git operations in your own repos
It's insane to me how many developers simply refuse to read documentation or spend any time at all learning the new tools they're supposed to use.
counttheforks··on Ask HN: What Happened to iOS Widgets?
Meanwhile the purpose of widgets is that you dont have to open the app. So apple prevents successful widgets from working once you're used to them. Doomed to fail.
← PreviousPage 4 of 11Next →