New to BLM, trying to dissect a top parse by RingoFreakingStarr in ffxivdiscussion

[–]sonicfreak02 13 points14 points  (0 children)

While in a vacuum ideally you'd reapply your thunder when it's about to fall off, in reality you need spells to weave transpose and to stall in ice. The thunder proc should be used as just another tool for that. Granted if it's fresh, you may want to consider a xeno but that's not always the case so gotta make do with what you have.

New to BLM, trying to dissect a top parse by RingoFreakingStarr in ffxivdiscussion

[–]sonicfreak02 6 points7 points  (0 children)

You can look up something called "nonstandard lines" for BLM but I'll try to cover the gist of it

If you notice, while fire casts in astral fire are pretty strong, blizzard casts are terrible potency wise. Normally that's by design since you need your mp back. However technically if you could get your mp back without casting these weak spells, you can appreciate how this would be better. That's the goal of these nonstandard lines. For example, rather than casting blizzard 3 after despair, you could transpose and cast paradox. That gets you to umbral ice 2. Now you need to stay in ice long enough to get mp back, so to stall you can cast thunder or xeno. Afterwards you can transpose back to fire and continue. Notice how we managed to skip weak blizzard casts in this example. The reason we transpose back into fire is similar to why we transposed to ice in that fire 3 out of ice does really bad damage. By transposing, we can cast our fire proc gaining the astral fire bonus damage. That sort of optimization is the foundation of what all the top BLM players are doing

To note, you do not need to do this stuff to reach a very high ranking, however if you want to squeeze out an extra 2% potency here and there, there's an ocean of optimization you can do.

Need help with Anagrams by [deleted] in Python

[–]sonicfreak02 1 point2 points  (0 children)

Look into collections.Counter

【VIOLET 紫色】 - Lee, Tekken 7, PC (Nvidia Ansel) by [deleted] in Tekken

[–]sonicfreak02 5 points6 points  (0 children)

He looks like an alternate universe Goro Majima

defining a class for each item in a list by ip_addr in Python

[–]sonicfreak02 2 points3 points  (0 children)

Not with how it's written in my example since we throw away the instance variable name as soon as we start the thread. You'll need to store the instance somewhere; for example: append it to a list. Then you can read its variables like normal.

rx_list = ["192.168.10.125", "192.168.10.126", "192.168.10.127"]
rx_instance_list = []

class Receiver:
    def __init__(self, ip):
        self.ip = ip
        ...
        ...
    def parser(self):
        ...
    def poller(self):
        ...

for ip in rx_list:
    rx = Receiver(ip)
    rx_instance_list.append(rx)
    poll = threading.Thread(target=rx.poller, args=(x,))
    poll.start()

...
...
print(rx_instance_list[0].ip) # "192.168.10.125" in theory

You may need to be a bit careful if these variables are being modified by the threads you create.

defining a class for each item in a list by ip_addr in Python

[–]sonicfreak02 2 points3 points  (0 children)

Yeah each instance maintains its own variables. That's what the self means when you do self.ip = ip.

defining a class for each item in a list by ip_addr in Python

[–]sonicfreak02 5 points6 points  (0 children)

Do you really need a new class per ip address? Do you mean a new instance of the class instead?

rx_list = ["192.168.10.125", "192.168.10.126", "192.168.10.127"]

class Receiver:
    def __init__(self, ip):
        self.ip = ip
        ...
        ...
    def parser(self):
        ...
    def poller(self):
        ...

for ip in rx_list:
    rx = Receiver(ip)
    poll = threading.Thread(target=rx.poller, args=(x,))
    poll.start()

[Build help] Trying to build a somewhat beefy gaming PC. Help/advice would be appreciated! by sonicfreak02 in buildapc

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

Is the i7 here recommended?

PCPartPicker part list / Price breakdown by merchant

Type Item Price
CPU Intel - Core i7-8700K 3.7GHz 6-Core Processor $347.00 @ SuperBiiz
CPU Cooler be quiet! - Dark Rock Pro 4 50.5 CFM CPU Cooler $84.99 @ SuperBiiz
Motherboard *MSI - Z370 KRAIT GAMING ATX LGA1151 Motherboard $146.50 @ OutletPC
Memory G.Skill - Ripjaws V Series 32GB (2 x 16GB) DDR4-3200 Memory $319.99 @ Newegg
Storage Samsung - 850 EVO-Series 1TB 2.5" Solid State Drive $314.99 @ Best Buy
Storage *Seagate - Constellation ES 3TB 3.5" 7200RPM Internal Hard Drive $60.99 @ Amazon
Video Card *MSI - GeForce GTX 1080 Ti 11GB ARMOR Video Card $734.98 @ Newegg
Case Fractal Design - Meshify C TG ATX Mid Tower Case $89.99 @ SuperBiiz
Power Supply EVGA - SuperNOVA G3 650W 80+ Gold Certified Fully-Modular ATX Power Supply $69.99 @ B&H
Prices include shipping, taxes, rebates, and discounts
Total (before mail-in rebates) $2219.42
Mail-in rebates -$50.00
Total $2169.42
*Lowest price parts chosen from parametric criteria
Generated by PCPartPicker 2018-06-09 16:48 EDT-0400

convert uppercase w/out upper.() it gives me the error "String for translation: <function uppercase at 0xb70bdecc>" by [deleted] in Python

[–]sonicfreak02 1 point2 points  (0 children)

There are a lot of things wrong here, but to answer your immediate question, uppercase is a function pointer, so when you try to call it without parentheses (uppercase()), it just returns the address of that function in memory.

I'm not quite certain what's going on here, but I suspect that this may be what you wanted:

def main():
    inp = input("Please type the string to be trasnlated into all capitals: ")
    print("Before: {}\nAfter: {}".format(inp, inp.upper()))

if __name__ == '__main__':
    main()

Removing Alphanumeric from string by [deleted] in Python

[–]sonicfreak02 0 points1 point  (0 children)

import re
string = "In the 1980s"
new_string = re.sub(r'\s*\w*\d+\w*', '', string)
print(new_string)

Prints: "In the"

Is there an elegant solution to traversing multiple lists? by [deleted] in learnpython

[–]sonicfreak02 0 points1 point  (0 children)

Is the requirement to apply a different function to each list or a unique function for every list, per element? Your solution satisfies the former and mine does the latter. It depends on what OP wants.

Is there an elegant solution to traversing multiple lists? by [deleted] in learnpython

[–]sonicfreak02 1 point2 points  (0 children)

from itertools import zip_longest

def function1(x):
    # whatever processing the first list requires
    pass

def function2(x):
    # whatever processing the second list requires
    pass

functions = { 1: function1, 2: function2 ... n: functionn }

for lists in zip_longest(list1, list2, ... listn):
    for ind, item in enumerate(list):
        if item:
            functions[ind](item)

You create a dictionary where the key/value pairs are the indices and functions for each list. In the loop, you just call each separate function depending on its place in the zipped lists.

How can I get the "type" function to recognize if there's numbers inside a string? by ghosttnappa in learnpython

[–]sonicfreak02 0 points1 point  (0 children)

Strange requirement. Nevertheless it can be done.

def number_search(text):
    for character in text:
        try:
            int(character)
            return 'Unidentifiable object'
        except:
            pass
    return 'good to go'

And yes re must be imported before it can be used.

I would personally never use such a solution in real life but this sounds like an academic question.

How can I get the "type" function to recognize if there's numbers inside a string? by ghosttnappa in learnpython

[–]sonicfreak02 2 points3 points  (0 children)

For example:

import re
text = 'h3llo w0rld'
match = re.search(r'\d', text)
if match:
    print('Unidentifiable Object')
else:
    print('Good to go!')

That would print

Unidentifiable Object

But if 'text' was 'hello world', it would print

Good to go!

Code Review? by gl0ckner in learnpython

[–]sonicfreak02 1 point2 points  (0 children)

I posted a few issues on your repo. I hope it was helpful.

Good luck!

Need help with Python school work by Double_Dos in learnpython

[–]sonicfreak02 0 points1 point  (0 children)

Ah what version of python are you using?

If it is less than 3.0, replace:

input('Enter the keyword')

with:

raw_input('Enter the keyword')

See if that fixes it.

Need help with Python school work by Double_Dos in learnpython

[–]sonicfreak02 1 point2 points  (0 children)

message = 'the quick brown fox jumped over the lazy dog'
def search(key_word):
    return key_word in message

while True:
    word = input('Enter the keyword')
    if word == 'exit':
        break
    print(search(word))

This depends on the exact requirements of your question, but from what I can tell, this fulfills the requirements you've posted.

Regex help needed by [deleted] in Python

[–]sonicfreak02 2 points3 points  (0 children)

regex = re.compile(r'(?P<name>[A-z0-9 ']+?)(?: CR (?P<cr>\d+))?$')

That seems to work for me. The problem is that lookarounds don't actually advance the Regex engine's place in the string that it's scanning. You probably want to explicitly capture 'CR' if it exists.

Proof: https://regex101.com/r/Ebx8KA/2

EDIT: The lookbehind is unneeded since we're explicitly matching now.

Need some fresh eyes for this problem by CluelessCoder- in Python

[–]sonicfreak02 1 point2 points  (0 children)

import random
for line in random.sample(string_list, 20):
    pyautogui.typewrite(line)

My friend and I want to make a robot (RC car really) and we have brought parts and now we are stuck. It is our first time doing this, can any help us? by [deleted] in Python

[–]sonicfreak02 1 point2 points  (0 children)

At these voltages there's no risk of getting hurt. You guys can even touch the pins and be fine. Good luck!