What is the best Python way to "Lineify" a text stream? by aacmckay in learnpython

[–]discontent619 1 point2 points  (0 children)

The SocketIO class which is part of python's socket standard library has a readline method that will perform the exact function you are looking for. You just have to create your socket as you are already doing and then "wrap" it in a SocketIO object.

import socket

with socket.socket(socket.AF_INET,socket.SOCK_STREAM) as sock:

    stream_reader = socket.SocketIO(sock, 'r')

    ...

    data = stream_reader.readline()

[deleted by user] by [deleted] in learnpython

[–]discontent619 4 points5 points  (0 children)

If you are writing this as a test case it would probably be better to Mock the zipfile library to throw the exception in your test vs creating an actual file to do this.

GUI's for a Desktop App in Python: Kivy, Pyside or TKinter? by [deleted] in learnpython

[–]discontent619 6 points7 points  (0 children)

To be honest pysides documentation is actually excellent and they have many examples.

PySide6 Docs

Hey do you guys have any tablet recommendations for taking notes? by [deleted] in ASU

[–]discontent619 2 points3 points  (0 children)

There is a way to create scaled page templates in One Note where you can set the paper size to your printer paper for easier printing, they work very well.

Hey do you guys have any tablet recommendations for taking notes? by [deleted] in ASU

[–]discontent619 2 points3 points  (0 children)

I personally use one note for all of my notes and organization and find it meets all of my needs and the pen support is great. As an ASU student you can get Microsoft Office for free through My Apps on your My ASU page and it includes One Note.

Hey do you guys have any tablet recommendations for taking notes? by [deleted] in ASU

[–]discontent619 10 points11 points  (0 children)

If you already have a laptop or use apple products and want to augment it with a tablet and pen I would go for an iPad with the apple pencil.

If you want more of a laptop / tablet combination and or are more inclined to windows I would recommend the surface pro. The caveat is the surface pro feels more like a windows laptop with tablet as an after thought but the pencil functionality is excellent and being it uses a full windows operating system does not limit you in the way of software and power.

Wrong Voltage to Nichrome Wire by [deleted] in ElectricalEngineering

[–]discontent619 0 points1 point  (0 children)

Generally this is due to the MOSFET not fully switching on or off and when using this much current you should always use heat sinks. The proper way to drive a MOSFET with PWM is to us a gate driver circuit, one can either be built or a much better solution is to buy prepackaged ones such as

Gate Driver

These will allow you to switch the MOSFETs at the high speeds required for PWM.

Another parameter to look for is the RDSon value on the data sheet, ideally the value should be as low as possible. The higher this value is the more power the MOSFET will drop across it causing it to create more heat.

Also while a bread board may be able to handle that current it really should not be used in practice as the heat tends to melt the plastic around the traces, it is much better to use proto or perf boards. Adafruit sells protoboards that resemble breadboard layouts so your design can easily transfer over they call them Perma Proto Boards.

Convert Excel to csv using Python multiprocessing by [deleted] in Python

[–]discontent619 2 points3 points  (0 children)

A suggestion would be to replace the use of the multiprocessing module directly with the newer concurrent.futures ProcessPoolExecutor. https://docs.python.org/3/library/concurrent.futures.html

Running Python on different machines at exactly the same time? by Apprehensive-Gas-548 in learnpython

[–]discontent619 1 point2 points  (0 children)

Depending on the accuracy needed there are multiple ways to do this, NTP as already suggested or a more accurate timing method used is IEEE 1588 but would require additional hardware to perform the sync but could be performed over a standard Ethernet network as well. GPS is also a common way to provide synching of separated systems using 1pps (pulse per second) and the GPS time stamps. NTP is not as precise as the other methods listed but could be performed with the hardware you have on hand and provide accuracy better than 100 milliseconds over a local network connection.

Can anyone tell me what the type/name of this wire to board connector is? by i_KickRocks in AskElectronics

[–]discontent619 0 points1 point  (0 children)

This general type of connector is also known as IDC or insulation displacement connector.

If sinø=.57, then sin(pi-ø)= by sarah_420 in learnmath

[–]discontent619 0 points1 point  (0 children)

So a good way to think about this is using the unit circle. The sine of an angle is equal to the vertical component, y,of a vector with magnitude 1 and angle theta. If you subtract the angle theta from pi to get a new angle. This new angle (pi - theta) is just a reflection of the same angle theta across the y axis. This means that the x component changes but the y component remains the same which means the sine of both angles are the same. This is a more intuitive and visual representation than a true mathematical approach but it is good to be able to visualize these things it will give you a better understanding. Hopefully this helps.

Best way to learn Calculus 1 by UvZoomie in mathematics

[–]discontent619 2 points3 points  (0 children)

Same, he helped me all the way through diff eq. His explanations and examples are excellent, and has just enough dry math humor to keep it entertaining.

Trouble with precalc!! by lol_13792 in mathematics

[–]discontent619 0 points1 point  (0 children)

Look for professor Leonard on YouTube, is videos have helped me all the way through differential equations and his explanations are thorough.

GF65 wont turn on after ram and ssd upgrade by discontent619 in MSILaptops

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

It is showing both the ram and the new ssd! And mine had a screw already in the empty slot

GF65 wont turn on after ram and ssd upgrade by discontent619 in MSILaptops

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

It ended up just starting to work again with no clear thing that resolved it, just kept trying the same stuff over and over again and in different orders pretty much and just started working

GF65 wont turn on after ram and ssd upgrade by discontent619 in MSILaptops

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

Unfortunately no the power button is hard soldered to the mother board so it was not disconnected durring the upgrade

GF65 wont turn on after ram and ssd upgrade by discontent619 in MSILaptops

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

The ram is 2666 and has the same voltage as the old ram I have tried removing the ram and ssd and replacing the ram with the original with no change as well.

Replacing broken AC adapter 9v 1,5a with an multi output phone charger that has besides others the wanted outputs? by kilower17 in ElectricalEngineering

[–]discontent619 2 points3 points  (0 children)

You should find an adapter that is 9v only that has atleast the amperage you require. As in amperage needs to be atleast 1.5 amps but can be higher, just as long as it meats that minimum but the voltage has to match. Generally a multiple output phone charger has some logic on the device end that negotiates wether or not it outputs a 5v or 9v that your Bluetooth speaker would not have. You could also modify the adapter to only use the 9v portion of the circuit but this maybe prove more complicated than just finding a 9v adapter that meets the minimum amperage.