Jump to content

AnotherMax

Member
  • Posts

    25
  • Joined

  • Last visited

Awards

This user doesn't have any awards

1 Follower

Recent Profile Visitors

476 profile views
  1. If you want to store it in a database you can use: Neo4J which is a graph database letting you store "nodes" and "links". Alternativly and probably simpler, you can use graphviz which I use the python library (pypi) to parse graphs / construct and parse etc. These can be saved to ".dot" files and uses the "DOT Language".
  2. I assume you noticed that the `public float breakForce = 100f;` isn't actually being used on line 54. Not super familier with Unity but you could try setting a negative motorTorque or value far exceeding "3500f". Or could be something to do with the "Slip based friction model" -> https://docs.unity3d.com/2020.1/Documentation/ScriptReference/WheelCollider.html
  3. So v1 has this "flat" keyword but v2 doesn't. You can see this in the v1.5.x docs:https://v15.vuetifyjs.com/en/components/buttons#flat I'm guessing the reason there are subtlties between v1 and v2 is simply the implementation between to the two. You could inspect the code e.g. the css output and compare them to find the differences. There is also this https://vuetifyjs.com/en/getting-started/upgrade-guide/#upgrading-from-v1-5-x-to-v2-0-x which you might find useful if you have more components to move across.
  4. It should be implemented out of the box. https://openlayers.org/en/latest/apidoc/module-ol_interaction.html https://openlayers.org/en/latest/apidoc/module-ol_interaction_PinchZoom-PinchZoom.html I assume you're using a somewhat recent version. You could try and hook into the 'on' call and do a console log. Last thing to check is whether it's supported on your device? If you're using an old device with old browers, could cause issues: https://caniuse.com/touch
  5. If you use the keywords 'text tile' on the v-btn e.g. <v-btn text tile v-for="item in nav" :key="item.icon" to="#" :title="item.title">{{ item.text }}</v-btn> That should be very similar. The docs are very good as they are interactive and let you see all the options for components: https://vuetifyjs.com/en/components/buttons/#usage Here explains what the two "text + tile" actually do: https://vuetifyjs.com/en/components/buttons/#text
  6. 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.
  7. 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 characteristic - probably easy to modify.
  8. 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-octal-binary-conversion-table for (int i = 0; i < 11; ++i) { // initilize pins pinMode(i, INPUT); // Add all the keys into the 'allKeys' with the correct values allKeys[i].pin = keys[i]; allKeys[i].keyToPress = x; allKeys[i].isActive = false; x++; } } void loop() { for (int i = 0; i < 11; ++i) { handleSwitchPin(allKeys[i]); } // Short delay delay(10); } boolean handleSwitchPin(KeyThing keyData) { if (digitalRead(keyData.pin) == HIGH && keyData.isActive == false) { // Store the pin thats pressed then set isActive to true so this can't be called again // by another pin keyData.isActive = true; Keyboard.press(keyData.keyToPress); } else if (digitalRead(keyData.pin) == LOW && keyData.isActive == true) { // This will only get called when the pin thats pressed is the 'pin' and it's LOW and it's active keyData.isActive = false; Keyboard.release(keyData.keyToPress); // Release specific key } } My C is a bit rusty so this might not work first time. I'd also come up with a better struct name other then 'KeyThing'
  9. 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.
  10. 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.
  11. 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)
  12. #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) == HIGH && isActive == false) { // Store the pin thats pressed then set isActive to true so this can't be called again // by another pin pinPressed = pin; isActive = true; doAction(pin); } else if (pinPressed == pin && digitalRead(pin) == LOW && isActive == true) { // This will only get called when the pin thats pressed is the 'pin' and it's LOW and it's active isActive = false; Keyboard.releaseAll(); } } void doAction(int pin) { switch (pin) { case 2: Keyboard.press('1'); break; case 3: Keyboard.press('2'); break; case 4: Keyboard.press('3'); break; case 5: Keyboard.press('4'); break; case 6: Keyboard.press('5'); break; case 7: Keyboard.press('6'); break; case 8: Keyboard.press('7'); break; case 9: Keyboard.press('8'); break; case 10: Keyboard.press('9'); break; } } Modifed your code a little (not tested). So this can currently only handle 1 switch at a time due to having two variables for storing the state. This could be fixed but would be slightly more complex. I personally prefer code examples to understand things. If you want more of an explanation as to why this works (assuming it does) either ask for further details or inspect the code and add print statements to see what variables are what and when (this can help you understand it)
  13. 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.
  14. 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?
  15. 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 `${filename}${(is_checked) ? 'F' : ''}.png` // Backticks allow for formatted strings } x = get_image_name("picture_1", true) // Returns --> picture_1F.png y = get_image_name("picture_1", false) // Returns --> picture_1.png You can ofcouse modify the 'F' to be what you want etc or even add it as an extra parameter. Though thinking about it, this may or may not work depending on how you get the 'current' filename. As if you get it from the 'src' you'd need ot strip out the 'F.png', To do that you'd want to first remove the '.png' as thats consitent could use: str.replace(".png", "") -> returns new string without '.png', then add a check to see if the magical 'F' is the last index in the string, if it is then you can replace that then you'll have the original file name without the prefix.
×