Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

fizzlesticks

Member
  • Content Count

    1,196
  • Joined

Reputation Activity

  1. Agree
    fizzlesticks got a reaction from Shiv78 in why am i getting this error in PYTHON 3   
    You're missing a ).
  2. Informative
    fizzlesticks got a reaction from Rakanoth in Websites which knows your new password is similar to your old one   
    Hashed, not encrypted.
     
    It could be encrypted, though that's almost as bad as plain text.
     
    Yes, many website store your last X passwords so you can't reuse them. They're still hashed and if they're not your current password that shouldn't be a problem.
  3. Agree
    fizzlesticks got a reaction from wONKEyeYEs in Websites which knows your new password is similar to your old one   
    Hashed, not encrypted.
     
    It could be encrypted, though that's almost as bad as plain text.
     
    Yes, many website store your last X passwords so you can't reuse them. They're still hashed and if they're not your current password that shouldn't be a problem.
  4. Funny
    fizzlesticks got a reaction from straight_stewie in Function   
    You use things that don't need indenting. For example here's elpiops answer in 1 line:
    print(dict((lambda d: (d, [d[name].add(item) for name, item in [("Thomas", "pen"), ("Mike", "pencilcase"), ("Thomas", "rubber"), ("Tom", "scissors")]])[0])(__import__('collections').defaultdict(set))))  
  5. Agree
    fizzlesticks got a reaction from 0x21 in Function   
    You use things that don't need indenting. For example here's elpiops answer in 1 line:
    print(dict((lambda d: (d, [d[name].add(item) for name, item in [("Thomas", "pen"), ("Mike", "pencilcase"), ("Thomas", "rubber"), ("Tom", "scissors")]])[0])(__import__('collections').defaultdict(set))))  
  6. Like
    fizzlesticks got a reaction from loganryan in Websites which knows your new password is similar to your old one   
    Hashed, not encrypted.
     
    It could be encrypted, though that's almost as bad as plain text.
     
    Yes, many website store your last X passwords so you can't reuse them. They're still hashed and if they're not your current password that shouldn't be a problem.
  7. Informative
    fizzlesticks got a reaction from vorticalbox in Python   
    list(set(s) ^ set(t))  
  8. Agree
    fizzlesticks reacted to vorticalbox in Recommendation for Portable Scripting Language   
    Care to define What these normal problems are?
  9. Informative
    fizzlesticks got a reaction from vorticalbox in Python input is the command prompt output from a seperate software   
    You could either pipe the output from the program to a python script or use the subprocess module to run the program from the python script and capture the output that way.
     
    To pipe the output, from the command line you would run
     
    BarcodeReader.exe | py my_python_script.py
     
    where my_python_script.py is using the input() function to get input.
     
    Or using the subprocess module make a script that does something like:
    import subprocess as sp proc = sp.Popen(['path/to/barcodereader.exe'], stdout=sp.PIPE) out = proc.stdout.read() print(out)  
  10. Like
    fizzlesticks got a reaction from ZacoAttaco in Don't know what's wrong with tip calculator. (Python)   
    You need to import time. If you open a command window / terminal and run it from there the window will stay open and you can see what error you're getting.
  11. Like
    fizzlesticks got a reaction from ZacoAttaco in Python: Merge Sort Error   
    The sample code is written in Python 2 where '/' is integer division. To accomplish the same thing in Python 3 you can use '//'.
  12. Informative
    fizzlesticks got a reaction from Sauron in Python: Merge Sort Error   
    The sample code is written in Python 2 where '/' is integer division. To accomplish the same thing in Python 3 you can use '//'.
  13. Informative
    fizzlesticks got a reaction from fpo in Compiler choices & linking APIs for C++   
    I just followed the quick start section on the github page then googled if I couldn't figure something out. 
    There is no linking to VS, the program edits some internal VS files to make things available in any project (if you did the integrate step in the guide.)
     
    vcpkg install sdl2 curl
    installs the 32bit dynamically linked versions of the libraries so make sure your project is set to x86
     
    if you want to get the 64 bit version use
    vcpkg install sdl2:x64-windows
     
    and for statically linked (if the library supports it, I don't know if sdl or curl do)
    vcpkg install sdl2:x86-windows-static
    for 32bit or
    vcpkg install sdl2:x64-windows-static
    for 64bit
     
    After installing you should be able to just #include <SDL2/sdl.h> and everything should work automatically.
     
     
  14. Informative
    fizzlesticks reacted to Unimportant in Python or C++   
    Many seem to think that simply squeezing Python code trough a C compiler will magically bring it up to speed. That naive view overlooks the true reason C and C++ can produce such fast code: undefined behavior.
     
    The C and C++ standards leave a lot of things undefined. There are some things you should not do, like going out of bounds on a array, and if you do - all bets are off.
    Many other languages, including Python, define almost everything. Going out of bounds on a array in Python results in a IndexError exception, I believe.
     
    That makes the Python code a lot safer and easier to debug (*), but it also means the implementation has to include all kinds of checks and tests in the code behind your back to be able to adhere to this standard. Accessing a array with a index that is computed at runtime ? (and thus, no clever compiler/interpreter can check index validity at compile time/beforehand) then the runtime code HAS to check the validity of the index every time the array is accessed, the language standard demands it. Such a check typically takes more time then the actual access, so it can slow things down a lot. And somehow converting the Python code to C/C++ does not help. If the converted application still has to adhere to the Python standard then all those checks and tests have to be added to the C/C++ code as well.
     
    The array access is just one example, there's many more behaviors that requires extra overhead if it has to be defined, some might find this article interesting:
    https://blog.regehr.org/archives/213
     
    (*) Al tough there's a lot of tools and programming paradigms these days to write very safe code in C++.
     
  15. Agree
    fizzlesticks got a reaction from fpo in New to Hardcore programming   
    Visual Studio's compiler doesn't support standard C and it never will. If you want to write straight C code you shouldn't be using VS.
  16. Agree
    fizzlesticks got a reaction from Unimportant in C Program Compiles but Segfaults [Commented Code]   
    int limit = (int)argv[1]; argv is an array of "strings", you can't just use a cast to get the int value.
  17. Informative
    fizzlesticks got a reaction from vorticalbox in Using python to access a specific value in JSON   
    The requests library has a built in JSON thingy.
    a=requests.get(url) print(a.json())  
  18. Agree
    fizzlesticks got a reaction from Dat Guy in Incorrect program run time C   
    Please post the code as text, not a screen shot. It makes it much easier to help.
  19. Agree
    fizzlesticks reacted to Sakuriru in Outdated Python...   
    I honestly wish python 2 would just die already.
  20. Like
    fizzlesticks got a reaction from madknight3 in It's advent time again   
    Advent of Code
     
    A new programming challenge every day from now until Christmas. 
  21. Agree
    fizzlesticks got a reaction from codesidian in What should I learn first?   
    Find out what language your school uses for their beginner classes and start learning that.
  22. Agree
    fizzlesticks reacted to Unimportant in Always returning 0 in C   
    For starters, 'fracBitIsolate' and 'expBitIsolate' are never assigned a value before you use them as parameters to call those functions.
     
    Also, you're doing questionable things like dual bitshifts on a sigle line:
    int fracIsolate = hex << (32 - fracBits) >> (32 - fracBits); Is this shifting 'hex' (32 - fracbits) to the left and then shifting the result of that (32 - fracbits) to the right ?
    Or is it shifting (32 - fracbits) (32 - fracbits) to the right and then shifting 'hex' to the left with the resulting amount of bits? Why not split such things up into multiple lines and give the programmers that come after you some headache relief.
  23. Agree
    fizzlesticks got a reaction from fpo in What should I learn first?   
    Find out what language your school uses for their beginner classes and start learning that.
  24. Agree
    fizzlesticks got a reaction from Pcgeekbrain in IDE for Python??   
    PyCharm or Visual Studio.
  25. Agree
    fizzlesticks got a reaction from Nuluvius in IDE for Python??   
    PyCharm or Visual Studio.
×