• Breaking News

    Saturday, October 3, 2020

    What is the theoretical limit of lossless audio compression? Ask Programming

    AskProgramming

    What is the theoretical limit of lossless audio compression? Ask Programming


    What is the theoretical limit of lossless audio compression?

    Posted: 03 Oct 2020 08:09 AM PDT

    Would it be possible to go any further than current FLAC? Are there still a lot of gains to be had, not much at all, or is there no way of really knowing?

    submitted by /u/Timill
    [link] [comments]

    Advice on what development framework or engine I should use for my project.

    Posted: 03 Oct 2020 07:01 PM PDT

    Hello, I am torn on what I should be using for my app I want to develop. My project is not QUITE a game but at the same time maybe it is. A user will send some information to another user, then that user will send the same info to another, etc. In the end, if the information all matches, then each "player" is awarded a star, or a coin or something along those lines.

    Fairly simply "gameplay". Is it really a game? It is "multiplayer asynchronous" I guess but does Unity really sound necessary? It will be a cross platform app for android and ios. I have looked into Xamarin. Any other ideas? Thanks a bunch.

    submitted by /u/KilowattQ
    [link] [comments]

    DASH protocol for encrypted file

    Posted: 03 Oct 2020 09:31 PM PDT

    I don't know if there is something like this out there but I've been thinking about creating an application that could stream video from a server that hosts encrypted video files.

    Ideally the server would send the file in packets that could be decrypted by the client application and played as video. I know about stream ciphers and so I know its possible to decrypt as you go with a file (I was planning on using AES CTR).

    My question is, would it be best to have the server just chop up the encrypted file and send each part when the client was ready for it and then have the client decrypt, encode each part of the video and serve it to the video player via a localhost server?

    I know this wouldn't really be DASH because it wouldn't have adaptive bitrate but I don't really know another term to use. I also don't know if there is a way easier way to do this and I'm just over complicating things.

    submitted by /u/parallacksgamin
    [link] [comments]

    How can I import those 'other files' using the Vue Router?

    Posted: 03 Oct 2020 02:57 PM PDT

    In the vue documentation (https://router.vuejs.org/guide/#html) , // 1. Define route components. // These can be imported from other files

     const Foo = { template: '<div>foo</div>' } const Bar = { template: '<div>bar</div>' } 

    I've been trying template: import('home.php'), template: url('home.php'), but no luck.

    submitted by /u/rachmanny
    [link] [comments]

    Sniffing POST commands for wifi climate system

    Posted: 03 Oct 2020 08:04 PM PDT

    I have a Seeley heating and cooling system that has a wifi controller called MagiqTouch. With their android app, I'm able to control the system from my phone remotely (including outside my local network).

    However, this app is not very good and some things simply don't work. I have been attempting to work out how the app communicates with the system so that I can replicate the commands without the app. The app uses the Amazon AWS and using Fiddler to capture my phones traffic, I have found the HTTP GET requests that get the system's current status when the app starts up.

    The main request is a GET to 57uh36mbv1.execute-api.ap-southeast-2.amazonaws.com/api/loadsystemrunning?macAddressId=xxxxxxxxxxx along with an authorization key. I can successfully replicate this outside the app and get the result with the system info.

    However, I've hit a bit of a snag as when I use the app to change something on the system (for example turning it on or off), nothing shows up in Fiddler. I have HTTPS enabled in fiddler and the decrypt option is on. Does anyone know how I'm able to find what it's doing using Fiddler or otherwise?

    Fiddler screenshot

    edit: I think I found it! Seems to be using mqtt - I'll have to do some reading, hopefully replicating this is not too hard.. image

    Thanks!

    submitted by /u/ProbablyPooping_
    [link] [comments]

    Very basic clustering question. Does anyone here know?

    Posted: 03 Oct 2020 07:14 PM PDT

    Gonna do this on google sheets or w/e else is simple

    Say you have a set of 5 items

    • These items are words, not numbers

    You have many sets of items

    How do you make it that items that were more frequent / common within each set are shown as being closer together / more related?

    On a data viz preferably

    submitted by /u/happypuppy100
    [link] [comments]

    Function Call in C?

    Posted: 03 Oct 2020 03:20 PM PDT

    I have a program that uses the Vigenere Cipher to encrypt/decrypt text from the user by having them input a phrase and a keyword. The program uses a 2d array to act as the Vigenere cipher and has 2 functions findRow & findColumn to find the intersection of the text. I'm struggling to call these 2 functions into my main function correctly and output the encrypted text. what is the correct way to call these 2 functions?

    Example of my current output:

    You have chosen the encryption path Young Padawan Enter Plaintext For Encryption: santa is coming to town Enter Key: ho Plaintext:santa is coming to town Mapped Key:hohohohohohohohohoh Cipher Text: ░ 

    When my goal output is:

    You have chosen the encryption path Young Padawan Enter Plaintext For Encryption: santa is coming to town Enter Key: ho Plaintext:santa is coming to town Mapped Key:hohohohohohohohohoh Cipher Text:zouhhwzqvapbnhvhvku 

    Here is part of my code(bit long due to my 2d array):

    #include<stdio.h> #include<string.h> int findRow(char vigSquare[][27], char ksub){ int i; while(vigSquare[i][0] != ksub){ i++; if(i==27){ return -1; } } return i; } int findColumn(char vigSquare[][27], char psub){ int j; while(vigSquare[0][j] != psub){ j++; if(j==27){ return -1; } } return j; } int main(){ char vigSquare[27][27]= { {' ','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'}, {'a','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'}, {'b','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','a'}, {'c','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','a','b'}, {'d','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','a','b','c'}, {'e','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','a','b','c','d'}, {'f','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','a','b','c','d','e'}, {'g','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','a','b','c','d','e','f'}, {'h','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','a','b','c','d','e','f','g'}, {'i','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','a','b','c','d','e','f','g','h'}, {'j','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','a','b','c','d','e','f','g','h'}, {'k','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','a','b','c','d','e','f','g','h','i','j'}, {'l','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','a','b','c','d','e','f','g','h','i','j','k'}, {'m','m','n','o','p','q','r','s','t','u','v','w','x','y','z','a','b','c','d','e','f','g','h','i','j','k','l'}, {'n','n','o','p','q','r','s','t','u','v','w','x','y','z','a','b','c','d','e','f','g','h','i','j','k','l','m'}, {'o','o','p','q','r','s','t','u','v','w','x','y','z','a','b','c','d','e','f','g','h','i','j','k','l','m','n'}, {'p','p','q','r','s','t','u','v','w','x','y','z','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o'}, {'q','q','r','s','t','u','v','w','x','y','z','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p'}, {'r','r','s','t','u','v','w','x','y','z','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q'}, {'s','s','t','u','v','w','x','y','z','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r'}, {'t','t','u','v','w','x','y','z','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s'}, {'u','u','v','w','x','y','z','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t'}, {'v','v','w','x','y','z','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u'}, {'w','w','x','y','z','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v'}, {'x','x','y','z','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w'}, {'y','y','z','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x'}, {'z','z','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y'}, }; char plaintext[50]; char key[40]; char ciphertext[50]; int i, j, l=0; int fRow,fColumn; int plainLength, keyLength; printf("You have chosen the encryption path Young Padawan\n"); printf("Enter Plaintext For Encryption:\n"); gets(plaintext); printf("Enter Key:\n"); gets(key); plainLength = strlen(plaintext); char mappedKey[plainLength]; keyLength = strlen(key); for(i = 0;i < plainLength; i++){ if(plaintext[i] !=' '){ //f it's not a space add 1 to l l++; } } //l is now how many non-space characters are in the string for(i = 0,j = 0;i < l; i++,j++){ if(j==keyLength){ j = 0; } mappedKey[i]= key[j]; } char ksub,psub; fRow = findRow(vigSquare,ksub); fColumn=findColumn(vigSquare,psub); ciphertext[i]= vigSquare[fRow][fColumn]; printf("Plaintext:%s\nMapped Key:%s\nCipher Text: %s\n", plaintext, mappedKey, ciphertext); return 0; } 
    submitted by /u/DynasticINF
    [link] [comments]

    weird calculation stuff

    Posted: 03 Oct 2020 05:25 PM PDT

    Im making a chrome extension and it calculates how much money you have worth of robux but when it calculates your robux and a gamepass robux cost it changes how much it says you have

    Codehttps://pastebin.com/BANKH4J7

    Example of what happens

    https://www.youtube.com/watch?v=ZCBn71UDqN8&ab_channel=JustDoomsStuff

    btw i am aware that my code may be inefficient or horrible, im still new to javascript

    submitted by /u/TheDoominatorYT
    [link] [comments]

    How much harder is a masters than the initial 4-year degree?

    Posted: 03 Oct 2020 06:23 AM PDT

    Are code-golf languages practical? Why is it based on the file size and not binary size?

    Posted: 03 Oct 2020 01:11 PM PDT

    Stumbled upon code golf but I honestly dont see the point in an unreadable 40 char program that probably produces a binary larger than that of a standard language or relies on libraries that are heavy on a target.

    I would also rather just not count white space against characters for the sake of readability in the comments. A C program that looks like i,l,n;f(n,m,s) isn't useful and the author is just going to write it normally and delete the spaces when submitting anyways.

    Arguably binary size is more important than a source file size and the two will usually coincide (obviously sometimes more text can result in a smaller binary).

    submitted by /u/Im_So_Sticky
    [link] [comments]

    A request for tips/critics/feedback on my small Python program

    Posted: 03 Oct 2020 02:53 PM PDT

    Hi all, I'm in the middle of the hiring process for a company I really like and they asked me to make a small Python exercise. The requirements are listed below this text. My question, does anyone have any tips, critics or feedback on the program?, I would love to hear anything I could improve before I hand in the project. I would appreciate any feedback a lot!!

    Requirements:

    • Create an application that given the data to represent 2 cubic objects in a 3-dimensional space is capable to determine if they intersect
    • If the cubes intersect determine what the volume of the shared space is.
    • The two cubes are parallel to each other (they are not rotated in any way).
    • To build each of the cubes the user must be able to provide coordinates (x,y,z) for the center of the cube and the length of the edge.

    * I upgraded the program bit to not only use 2 cubic objects but to use as many as the user puts in, as a small extra.

    Edit: I created a repo on Github quickly since the code below isn't very readable on Reddit, it can be found here: https://github.com/Jimballoons/cubes/blob/main/cube.py

    Thank you!

    import itertools

    class Cube: id_iterator = itertools.count(1)def __init__(self, xmin, ymin, zmin, xmax, ymax, zmax):self.id = next(self.id_iterator)self.xmin = xminself.ymin = yminself.zmin = zminself.xmax = xmaxself.ymax = ymaxself.zmax = zmax

    def main(): number_of_cubes = prompt_number_of_cubes() cubes = prompt_cubes(number_of_cubes) results = shared_volumes_between_cubes(cubes) print_results(results)

    def prompt_number_of_cubes(): user_input = input("How many cubes would you like to use? \n")while not is_valid_number_of_cubes(user_input): user_input = input("Input must be an integer higher than 1. How many cubes would you like to use? \n")return int(user_input)

    def prompt_cubes(number_of_cubes): cubes = []for i in range(number_of_cubes): prompt_string = f"Provide the x,y,z coordinate for the center, followed by the edge_length, of cube #{i + 1}. Seperate the values with a comma. For example: '10, 12, 20, 3' \n" user_input = input(prompt_string)while not validate_cube_properties(user_input): user_input = input(f"Try again. " + prompt_string) cubes.append(create_cube(user_input))return cubes

    def shared_volumes_between_cubes(cubes): results = []for index, cube_1 in enumerate(cubes):for cube_2 in cubes[index+1:]: volume = shared_volume(cube_1, cube_2) results.append( {"cube_1": cube_1.id, "cube_2": cube_2.id, "volume": volume})return results

    def print_results(results):for result in results: response = f"The result of comparing cube {result['cube_1']} with cube {result['cube_2']}: "if not result["volume"] or result["volume"] == 0: response += "No intersect"else: response += f"{result['volume']}m^3"print(response)

    def is_valid_number_of_cubes(input):try:if int(input) > 1:return Trueexcept ValueError:return False

    def validate_cube_properties(properties):try: properties = list(split_properties(properties))except ValueError as error:print(error.args)return Falseelse:if len(properties) != 4 or properties[3] < 1:print(f"The input '{properties}' is invalid.")return Falsereturn True

    def shared_volume(cube_1, cube_2): dx = min(cube_1.xmax, cube_2.xmax) - max(cube_1.xmin, cube_2.xmin) dy = min(cube_1.ymax, cube_2.ymax) - max(cube_1.ymin, cube_2.ymin) dz = min(cube_1.zmax, cube_2.zmax) - max(cube_1.zmin, cube_2.zmin)if (dx >= 0) and (dy >= 0) and (dz >= 0):return dx*dy*dz

    def split_properties(properties):return map(int, properties.split(","))

    def create_cube(properties): x, y, z, edge_length = split_properties(properties) xmin = x - edge_length/2 ymin = y - edge_length/2 zmin = z - edge_length/2 xmax = x + edge_length/2 ymax = y + edge_length/2 zmax = z + edge_length/2return Cube(xmin, ymin, zmin, xmax, ymax, zmax)

    if __name__ == "__main__": main()

    submitted by /u/SenyorGlobo
    [link] [comments]

    C++ Program Help

    Posted: 03 Oct 2020 02:19 PM PDT

    Hello, I am fairly new to programming and have to do a project for class. I keep getting this error in visual studio "undefined reference to `InvestmentCalc::InvestmentCalc(float, float, float, int)'". When i put the function definitions in the .h or in the main.cpp file the code I have works perfectly, which is why I left out some of those details.

    here is my code in 3 files

    InvestmentCalc.h

    #Investment_Calc_H
    #define Investment_Calc_H
    #include <iomanip>
    #include <iostream>
    using namespace std;

    class InvestmentCalc {
    public:
    InvestmentCalc(float, float, float, int);
    void InterestNoDeposit();
    void InterestWithDeposit();
    float totalAmount;
    float interestAmount;
    float yearlyInterest;
    private:
    float m_initialAmount;
    float m_deposit;
    float m_interest;
    int m_years;
    };

    No comments:

    Post a Comment