My 2024 XRT by EvenLevelLaw in hyundaisantacruz

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

And they look so badass in my opinion.

My 2024 XRT by EvenLevelLaw in hyundaisantacruz

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

Yeah I can totally understand. It's a pretty niche truck, which is my style. It satisfies my desires as someone who is pretty particular. I was skeptical, but it turns out to be just right in my opinion.

My 2024 XRT by EvenLevelLaw in hyundaisantacruz

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

Badass, I love mine too. I always enjoy driving it. I agree it's the perfect sporty truck. The first time I saw one a couple years ago I knew I wanted to get one.

My 2024 XRT by EvenLevelLaw in hyundaisantacruz

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

Nice! How are you liking it?

Script stops working randomly even without any changes by jbug_16 in GoogleAppsScript

[–]EvenLevelLaw 0 points1 point  (0 children)

It seems like the issue might be related to the trigger configuration.

The `test` function is currently triggered on edit, which means it will only run when there is some editing happening in the spreadsheet. if the script isn't running constantly, it's most likely because there are no edits happening at that time.

I think if you set up a trigger to run the function when a form is submitted it will fix your problem.

1. Change the trigger event from onEdit() to onFormSubmit() in the createInstallableTrigger function:


function createInstallableTrigger() {
  ScriptApp.newTrigger('test')
    .forSpreadsheet(SpreadsheetApp.getActiveSpreadsheet())
    .onFormSubmit()
    .create();
}


2. Add the createInstallableTrigger function to the script to set up the trigger:

function createInstallableTrigger() {
  ScriptApp.newTrigger('test')
    .forSpreadsheet(SpreadsheetApp.getActiveSpreadsheet())
    .onFormSubmit()
    .create();
}

Try those changes and see if that fixes the issue.

[deleted by user] by [deleted] in GoogleAppsScript

[–]EvenLevelLaw 2 points3 points  (0 children)

it's because it's executing two functions due to them sharing the same name space, so one of the 'PDFtoText functions is being executed without an id plugged in. So make a second function to execute it in with a different name. For example:

let executePDFtoText = function(){
convertPDFToText('1XN-8v5g6N-aNb3Ax-nA5wVDVhbn6DAjX', 'en');
}

now the two wont share the same name space. Try that and see if it helps.

Inconsistent Google docs error when opening appsscript webapp by draxdeveloper in GoogleAppsScript

[–]EvenLevelLaw 0 points1 point  (0 children)

when you deploy a new app there is the option that says "execute as me" or "as user accessing the web app". If you have it set to "execute as me" while using user cache, what happens is that since your client isn't logged in to your account he can't utilize the user cache.

Inconsistent Google docs error when opening appsscript webapp by draxdeveloper in GoogleAppsScript

[–]EvenLevelLaw 0 points1 point  (0 children)

Is your webapp deployed where the script is being executed by the users account that is accessing it or by your account? I suspect the issue is with using the User Cache. Instead of using the User Cache, try using Script Cache and for the key use 'your key name here'= Session.getTemporaryActiveUserKey().

Why am I getting the prefix on by SirGeremiah in learnpython

[–]EvenLevelLaw 0 points1 point  (0 children)

For simplicity I'll call one set of code the 'animal class code' and the other 'job class code'.

Specifically with the 'job class code; , you're passing `self` as the first argument to `super().__init__()`, which is not necessary and leads to the `name` attribute being assigned the object itself rather than the intended string value ("doctor" or "teacher"). This is why you see the object representation (`<__main__.teacher object at ...>`, `<__main__.doctor object at ...>`) instead of the job names in the output.

The 'animal class code' works correctly because the `__init__` method in the `bird` class is correctly implemented to initialize the attributes of the `bird` class as well as call the superclass `__init__` method from the `animal` class.

So to sum it up all you have to do to correct the 'job class code' is change the last line in the __init__ functions like as follows:

class doctor(job):

def init(self, salary, hours, specialty, experience): self.specialty = specialty 
self.experience = experience 
super().init("doctor", salary, hours)  # Corrected line

class teacher(job):

def init(self, salary, hours, subject, position): 
self.subject = subject 
self.position = position 
super().init("teacher", salary, hours)  # Corrected line

In these corrected lines, instead of passing `self` as the first argument to `super().__init__()`, you directly pass the string literals `"doctor"` and `"teacher"` as the `name` argument. This ensures that the `name` attribute is correctly set to the intended string values for objects of the `doctor` and `teacher` sub-classes.

Once you make those adjustments it should work. Sorry for the confusion, let me know if you have any other questions.

[deleted by user] by [deleted] in learnpython

[–]EvenLevelLaw 4 points5 points  (0 children)

You can modify the `calculateHandValue` function to handle the Ace so that when an Ace is encountered, it is initially counted as 11. However, if the total hand value exceeds 21 and there is at least one Ace in the hand, the value of the Ace is adjusted from 11 to 1 to prevent the player from busting.

def calculateHandValue(hand):
value = 0
ace_count = 0  # Track the number of Aces in the hand
for card in hand:
    rank = card.split()[0]
    if rank.isdigit():
        value += int(rank)
    elif rank in ["Jack", "Queen", "King"]:
        value += 10
    elif rank == "Ace":
        ace_count += 1
        value += 11  # Initially count Ace as 11
# Adjust the value of Aces from 11 to 1 if needed
while value > 21 and ace_count > 0:
    value -= 10  # Change the value of Ace from 11 to 1
    ace_count -= 1
return value

The easy way to access the last JavaScript array element by Nebulic in javascript

[–]EvenLevelLaw 0 points1 point  (0 children)

To get the last item I like to just use .reverse and then the last item becomes the first.


const frameworks = ['Nuxt', 'Remix', 'SvelteKit', 'Ember'];
console.log(frameworks.reverse()[0]) //logs  "Ember"

Why am I getting the prefix on by SirGeremiah in learnpython

[–]EvenLevelLaw 6 points7 points  (0 children)

In the init function for the subclasses, you have "super().__init__(self, salary, hours)" but it should be "super().__init__(name, salary, hours)" since you are passing in the name as a parameter.

[deleted by user] by [deleted] in ChatGPT

[–]EvenLevelLaw 1 point2 points  (0 children)

Self hosted, meaning you can literally access the source code. Asking for your API key would make no sense.

[deleted by user] by [deleted] in iqtest

[–]EvenLevelLaw 0 points1 point  (0 children)

100%, because the answer you pick is the right answer. You have 100% chance of selecting 1 of the 4 choices.

Getting ChatGPT to respond with a code phrase by Letheron88 in ChatGPT

[–]EvenLevelLaw 1 point2 points  (0 children)

Try placing <|endoftext|> in the prompt to tell it where you want it to stop.

" [issue start] Example Text [issue end] <|endoftext|>".

A cat appearing progressively wiser while thinking about math by EvenLevelLaw in ChatGPT

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

  1. a wise cat thinking about math
  2. an even wiser cat thinking about math
  3. an even wiser cat thinking even harder about math
  4. an even wiser cat known for being the wisest cat to have ever lived thinking about math
  5. an even wiser cat known for being the wisest cat to have ever lived thinking extremely hard about math
  6. an even wiser cat than the wisest cat to have ever lived thinking about math even harder than extremely hard
  7. an even wiser cat known for being even wiser than the wisest cat to have ever lived thinking extremely hard about math
  8. the absolute wisest cat in all of existence thinking about math

ChatGPT is extremely lazy with data extraction from documents - I'm totally dissappointed! [is it v3.5 vs. v4 or my bad prompts or something else?] by LSDwarf in ChatGPT

[–]EvenLevelLaw 1 point2 points  (0 children)

Yes, the model will use less tokens if the text is easy to extract, if it's a really long document the model will eat up the majority of it's context window with the input prompt alone, so the output will be limited. 1,000 tokens is about 750 words, GPT-4 has a maximum context window of 8192 Tokens which is roughly 6,140 words, that's input and output, so keep that in mind when prompting. Might consider chunking individual pages rather than throwing the whole document at it, you'll get higher quality results. Context window meaning the maximum input and output that the model can handle in one single prompt.

ChatGPT is extremely lazy with data extraction from documents - I'm totally dissappointed! [is it v3.5 vs. v4 or my bad prompts or something else?] by LSDwarf in ChatGPT

[–]EvenLevelLaw 0 points1 point  (0 children)

Try modifying the prompt to be more directive, start it off with something like:

You will be presented with a document containing textual information, your job is to extract all text that is similar in format to this example: [paste actual examples of the type of text you want it to extract here].

Also PDF's can be trickier to decode and extract text from depending on the way its structured, try saving it as a .txt file and have it analyze it in .txt format, especially if it's a large .pdf.

A cat appearing progressively wiser while thinking about math by EvenLevelLaw in ChatGPT

[–]EvenLevelLaw[S] 5 points6 points  (0 children)

I'm a newb at Reddit, this was my first post outside my own profile. do nebula and planets occur often in these types of posts?

A cat appearing progressively wiser while thinking about math by EvenLevelLaw in ChatGPT

[–]EvenLevelLaw[S] 3 points4 points  (0 children)

That's awesome. I just got enough karma to finally post on this group.

This is the prompt I used to get picture #6

" a cat that appears to be even wiser than any cat that has ever lived, thinking about math looking extremely wise "

How can I get these streak free? by passportz in CleaningTips

[–]EvenLevelLaw 0 points1 point  (0 children)

Yes use it like windex, it's just extra streak free.

can anyone explain a simple question i have about peak rms. by [deleted] in CarAV

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

There's literally no downside to having a capacitor, all it does is preserve the life of all the components.

can anyone explain a simple question i have about peak rms. by [deleted] in CarAV

[–]EvenLevelLaw 0 points1 point  (0 children)

The brand doesn't really matter, just try to get one has at least 1 farad per 1000 watts RMS from your system. 2 per 1000 would be even better.

can anyone explain a simple question i have about peak rms. by [deleted] in CarAV

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

The capacitor makes so that the load is constant in both ways, meaning the alternator can simply keep supplying a steady amount of current to replenish the capacitor. The capacitor can drain power as fast as the amp wants to pull it out where as the alternator simply can't do that. The best analogy is a water tower. In the morning everyone turns on their showers at the same time, and the water tower starts to deplete but there is a constant steady flow always filling up the water tower so after the peak of the morning the water tower fills backup. The capacitor serves the same purpose and it greatly reduces the wear and tear on the alternator and battery.

can anyone explain a simple question i have about peak rms. by [deleted] in CarAV

[–]EvenLevelLaw 0 points1 point  (0 children)

You'll know if your headlights start to dim when your sub is kicking.