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

AnotherMax

Member
  • Content Count

    20
  • Joined

  • Last visited

Awards

This user doesn't have any awards

About AnotherMax

  • Title
    Newbie
  1. Yeah that's sounds tricky, sorry I couldn't help out more! Maybe a naive appoarch, but couldn't you brute force it? e.g. the DataView will have a limited amout of bytes and I suppose you could observe the changing value.
  2. Can't say I'm brushed up on this but looked quite interesting, did a little digging and saw this example: https://developer.mozilla.org/en-US/docs/Web/API/BluetoothCharacteristicProperties If I understand correctly you're just trying to read the data from the cscMeasurement? The above implies that the `event?.target` has a 'value' (Not a DataView?). I came across this as well: https://googlechrome.github.io/samples/web-bluetooth/discover-services-and-characteristics.html?optionalServices=link_loss Might help you debug ~ though that just seems to show the properties of a given characterist
  3. Take a look at the top of the code that's commented out. Personally, I'd take an approach where you create an array of struct such as that and store all the data within those: e.g. #include "Keyboard.h" int keys[] = {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}; // A nicer way would be to include an array of something like so struct KeyThing { int pin; char keyToPress; boolean isActive; }; KeyThing allKeys[12]; void setup() { Keyboard.begin(); // '1' starts at the decimal number 49 int x = 49; // https://www.ibm.com/docs/en/aix/7.2?topic=adapters-ascii-decimal-hexadecimal
  4. Oh good point, I was thinking of debouce incorrectly in my little brain. You will probably want to re-add you're debounce back in given what minibois has stated.
  5. https://developer.valvesoftware.com/wiki/Source_SDK_2013 ? https://github.com/ValveSoftware/source-sdk-2013 Once that is done, you'd need to "Mod" the game to how you want it. Valve have some quite extensive documentation on using the SDK. e.g. Has a bunch of different changes to UI / new guns that sorta thing.
  6. You can do that sort of behaviour with sets: fruits = {"apple", "banana", "cherry"} print(fruits - {"apple"}) # or to actually remove it. fruits -= {"apple"} print(fruits)
  7. #include "Keyboard.h" int keys[] = {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}; // A nicer way would be to include an array of something like so // //struct KeyThing { // int key; // char keyToPress; // boolean isActive; //}; // //KeyThing keyData[12]; int pinPressed = 0; boolean isActive = false; void setup() { Keyboard.begin(); for (int i = 2; i < 13; ++i) { // initilize pins pinMode(i, INPUT); } } void loop() { for (int i = 2; i < 13; ++i) { handleButtonPin(i); } // Short delay delay(10); } boolean handleButtonPin(int pin) { if (digitalRead(pin) == HIG
  8. I think a bit more info is needed to help: What do you want the actually functionality to be (what behaviour do you want)? e.g. A toggle (you press and it holds)? A you press and it holds for a short while? If it just spams a bunch that implies the switches you are using might already be toggle switches as oppose to buttons? I don't think what minibois said would help as delaying going into the `doAction(i)` function won't change the actual delay between when the button is pressed and released.
  9. I could be miss understanding but your asking why is there more then one row in the database or that when you refresh the page it inserts two records at once? Everytime you run the browser / load this up it will insert a new row into the database. Maybe you want a constraint in the database to not have a row with the same name and age?
  10. I don't really know any JQuery any more but if you want to programmtically add/remove something based on a boolean value it should be quite straight forward like so: This uses formated strings, so you can kinda add variables into strings using `${variable_name}` or a ternary operater which are really nice to use: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Conditional_Operator function get_image_name(filename, is_checked) { // Returns the file name with 'F' attached if is_checked is true, // otherwise just the filename with '.png' appeneded. return `$
  11. Yeah, it seems to be whats happening, you can still get just backend dev jobs but they are just harder to find. You can however in python use templating to generate static html pages like: Jinja or check out this: https://wiki.python.org/moin/Templating I was hired doing just backend but started doing frontend, not that I super wanted to but it has grown on me. (we use VueJS which is picking up traction)
  12. At work we use Python 3 with connexion and swagger to create endpoints for our frontend tools. I'd say to mess around with that, make a few things etc put on GitHub or something. Full-stack is much more desirable to employers.
  13. Assuming all '.py' files are in the same directory, and 'file_to_import.py' is simply made up of a bunch of function I'd do: from file_to_import import function_name_1, function_name_2 from file_to_import import * # Imports all functions from 'file_to_import' I wouldn't do the import with the ` * ` as it's a bit ambiguous. If you have a directory structure like: - main.py - utils \ - thingy.py If you want to import 'thingy.py' functions into the 'main.py' you can do: from utils.thingy import function_name_1, function_name_2
  14. It looks like you're using this: https://www.npmjs.com/package/firebase/v/3.1.0 Perhaps try and incude just the things you need (This would make the website download less which is good: <script src="https://www.gstatic.com/firebasejs/3.1.0/firebase-app.js"></script> <script src="https://www.gstatic.com/firebasejs/3.1.0/firebase-auth.js"></script> <script src="https://www.gstatic.com/firebasejs/3.1.0/firebase-database.js"></script> <script src="https://www.gstatic.com/firebasejs/3.1.0/firebase-storage.js"></script> Alternativly
  15. Second "if" statement, the `cpu[0].vetorDeIO` looks to be an array. // cpu[0].vetorDeIO => cpu[0].vetorDeIO[0] // this if (cpu[0].tempodeExecucao == cpu[0].vetorDeIO) {... // to if (cpu[0].tempodeExecucao == cpu[0].vetorDeIO[0]) {...
×