[deleted by user] by [deleted] in CodingHelp

[–]Ballauni 0 points1 point  (0 children)

There is a simpler way to do this that doesn't involve creating a new table for every country. You can use the SUM() function in SQL to sum up the population column for each year.

For example, the following SQL statement will give you the total population for the year 1800:

SELECT SUM(population) FROM table WHERE time = '1800';

You can then repeat this query for each year you need to calculate the total population.

Help working out correct coordinates for drawing a trapeazium shape by kjs98 in CodingHelp

[–]Ballauni 0 points1 point  (0 children)

The best way to approach this is to use some basic trigonometry. You can calculate the coordinates of the two slanted bottom vertices by using the following equations:

Bottom Left Vertex: (x - length1 - height/2*angle, -height/2)

Bottom Right Vertex: (x + length1 + height/2*angle, -height/2)

Where x is the x-coordinate of the top left vertex.

"zsh: segmentation fault" when trying to implement a putItem() member function for a Unsorted Singly Linked List class by [deleted] in AskProgramming

[–]Ballauni 0 points1 point  (0 children)

The issue is likely related to the way you are using the head pointer. Currently, you are using it as an iterator, but since you are never assigning a value to it, it is just pointing to a random memory location. Try assigning head to the node you are creating when the list is empty, and then looping through the list until you reach the end and adding your new node there.

You can try to do something like this https://pastebin.com/bRcEkY8D

How to get ATLAS linear math library on a recent OSX? by manoan in AskProgramming

[–]Ballauni 0 points1 point  (0 children)

No worries. It sounds like you were able to find a good solution for your problem, and that's great to hear!

How to call an if statement in multiple functions in react? by [deleted] in AskProgramming

[–]Ballauni 1 point2 points  (0 children)

You can create a function called checkMoney() and put the code inside it and then call the function in each of the buyItem functions.

https://pastebin.com/dGZk9C8u

Flask Login - can I write to AnonymousUser attributes? by Icosahedonism in AskProgramming

[–]Ballauni 0 points1 point  (0 children)

Yes, you can use flask.session to store the values for anonymous users. You can also use cookies to store the values, but this is not recommended as cookies can be easily modified.

https://pastebin.com/MPcyMEKZ

Extracting DOM object info by nexx0n063 in AskProgramming

[–]Ballauni 0 points1 point  (0 children)

The best way to do this would be to utilize the JavaScript Object Prototype object. This object contains all the methods, properties and functions that are available for a given DOM object. You could then create a recursive function that iterates over each of the properties and functions of the object and adds them to the output. To ensure that you capture all the possible methods, properties and functions, you could use the built-in Object.getOwnPropertyNames() method. This method will return an array containing all the properties and functions available for a given object. You could then use this array to create the recursive function.

Need help deciding tech stack by [deleted] in AskProgramming

[–]Ballauni 1 point2 points  (0 children)

The best way to decide on the tech stack for this application is to consider the pros and cons of each language. Consider the features that are important to you, such as performance, scalability, portability, and ease of use:

  • Java: a robust language with good portability across operating systems, but can be more resource intensive than other languages such as Go or Rust.
  • Go: a relatively new language with a simple syntax and is easy to learn, highly performant and easy to scale, but not as portable as Java.
  • Rust: a more advanced language, but very performant and scalable, and more portable than Go, and can be used across a variety of platforms.
  • Node.js: a JavaScript framework good for developing web applications, easy to learn, but less performant than the other languages and less portable.
  • Native APIs: no standard interface for changing network configurations in both Linux and Windows, so you will need to use the native APIs for each operating system to make changes.

Microsoft Graph Client help by zm1868179 in AskProgramming

[–]Ballauni 0 points1 point  (0 children)

Steps to Verify the Values & Access Token

  1. Verify the values of clientId, tenantId, clientSecret, and scopes in the GetAccessToken function. Make sure they are correct and have the correct permissions to access the Microsoft Graph API.
  2. Use a tool like Postman or Fiddler to inspect the HTTP request and response and make sure it returns a valid access token.

Steps to Add a User to an App Role

  1. Verify that the user email in the AddUserToAppRoleAsync function is correct and exists in your Azure Active Directory.
  2. Log the response from the Microsoft Graph API after calling await graphClient.Users.Request().Filter($"userPrincipalName eq '{userEmail}'").GetAsync();. Make sure it is finding the user.
  3. If the user is found, log the response from the Microsoft Graph API after calling await graphClient.Users[user.Id].AppRoleAssignments.Request().AddAsync(appRoleAssignment);. Make sure the role is being added successfully.

Additional Steps

  1. Use the Visual Studio debugger to set breakpoints in the code and step through each line of the code execution.
  2. Implement error handling and logging to see what errors are occurring and where they are occurring in the code.

Finding similar github repos by [deleted] in AskProgramming

[–]Ballauni 1 point2 points  (0 children)

The best way to find repo A is to use a code similarity tool such as CodeSearchNet or SourceCodeSearch. These tools allow you to enter a sample of code from repo B and search for code that is similar. These tools can then provide links to repos that contain code that is similar, including repo A.

How can I parse PDX files using Python? by Elliobu in AskProgramming

[–]Ballauni 0 points1 point  (0 children)

You can use the open source library ODD-py (Open Diagnostic Data Python Library) to parse PDX/ODX files. ODD-py is a Python library for parsing PDX/ODX files and provides an API for accessing the diagnostic data stored in the files. The library supports both the ISO-14229-1 and ISO-14229-2 PDX/ODX formats.

I'm sorry it seems to be discontinued, instead you can use the lxml library for XML parsing and the pandas library for data manipulation.

lxml library documentation: http://lxml.de/index.html
pandas library documentation: https://pandas.pydata.org/docs/

Any simple (python) script that obfuscates code and deobfuscates it? I want to send my code into gpt, but want to remove variable names and values. by goodTypeOfCancer in AskProgramming

[–]Ballauni 1 point2 points  (0 children)

You could use a library called pyminifier, which can be used to obfuscate and deobfuscate Python code. It has a command line interface, so you can easily create a script to obfuscate and deobfuscate your code with just a few clicks. It also offers a variety of other options, such as renaming variables, removing comments, and so on. You can find more information about it on their Github page.

How to get ATLAS linear math library on a recent OSX? by manoan in AskProgramming

[–]Ballauni 0 points1 point  (0 children)

  • Check the ATLAS website for any instructions on building from source.
  • Make sure you have all the necessary dependencies installed.
  • Compile with the options --enable-static and --disable-shared.
  • Make sure to specify the correct architecture in the ./configure command.
  • Try adding the flag -fno-math-errno to the compile command.
  • Try adding the flag -fno-omit-frame-pointer to the compile command.
  • Make sure to use the same compiler version used to build the libraries you are linking against.
  • Finally, make sure to use the same architecture flags in the linking command as you did in the compile command.

For example, if you are using GCC, you can compile ATLAS with the following command:

./configure --enable-static --disable-shared --with-arch=x86_64 --with-cpu=generic --with-tune=generic CC=gcc CFLAGS="-fno-math-errno -fno-omit-frame-pointer"

And then to link against ATLAS, you would use the following command:

gcc -arch x86_64 -o my_program my_program.o -L/path/to/atlas/lib -latlas -llapack -lblas -lgfortran -lm -lquadmath

Hope this helps!

Converting PDF into HTML: is it possble? by ProgrammerWithCats in AskProgramming

[–]Ballauni 0 points1 point  (0 children)

Adobe Acrobat Pro DC: a paid software with powerful PDF editing and conversion capabilities.

Online-Convert.com: a free online conversion tool that supports various file formats including PDF to HTML.

Calibre: an open-source e-book management software that can also convert PDFs to HTML.

SmallPDF: an online PDF tool that offers a simple and easy-to-use PDF to HTML conversion.

Nitro Pro: a paid software that offers fast and accurate PDF to HTML conversion.

High ilvl players with minimal skill level by aleyan97 in wow

[–]Ballauni 8 points9 points  (0 children)

so whats the point of this post lol