Plotting fidelity graph [closed] - c

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 1 year ago.
Improve this question
I want to plot a graph for fidelity with respect to time.
My function is
Here F is fidelity and consider alpha = sqrt of 5.
How to plot this?
Can you give me some model programming code and recommend me some online site for plotting this?

Plot Online (wolframalpha.com)
When it comes to programming, that depends on the desired output. This could be only the screen (gdi, directx, opengl), raster graphics (bmp, jpg, png, ...) or vector graphics (svg, gltf, ...).
But before you (can) put anything out, you would have to calculate the plot points first. Here you definitively need the standard math library (math.h).
Once you have your set of points, you could plot them by using additional software like plotutils.

Related

What are the different file formats for embroidery? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 9 days ago.
This post was edited and submitted for review 8 days ago and failed to reopen the post:
Original close reason(s) were not resolved
Improve this question
My husband owns a Bernina embroidery machine and I'm eager to explore the possibility of generating designs through programming. What programming language would be best suited for writing a program to output data in a format compatible with the Bernina embroidery machine's software, or for converting from a format such as HPGL to the appropriate format for the machine? My objective is to either figure out how to output data in a format compatible with the machine's software, or alternatively, find a free or low-cost tool that can convert from a format I can produce, such as HPGL or any other well-documented format, to the appropriate format for the machine. My aim is to create a file with one XY coordinate per stitch, including instructions for thread changes (pauses for thread switching), without relying on features like area fills, stitch spacing adjustments, or stitching order optimization, as I prefer to manage these elements myself.

Can I minimax a battleship 2 player game? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 10 months ago.
Improve this question
I have a game project to implement and was thinking of building a battleship game (https://en.wikipedia.org/wiki/Battleship_(game)).
The project requires me to build an AI computer that can run a minimax algorithm.
Is it possible to implement minimax on this kind of game?
Short answer: No.
The minimax algorithm needs some sort of evaluation of the gamestate in every node. In battleship you don't have all information as a player or AI (opponent ships are not known) which makes it impossible to do this. You could of course cheat and let the AI test all possible moves and find the hidden ships X moves ahead, but I would say this is against the rules.
The AI would then always find the ship and always make hits which would also make it very boring to play against.
You can find some inspiration for example here on other algorithms to use.

Rendering 1 bit per pixel image via opengl [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
Recently I've started implementing CHIP-8 emulator in C. After implementing most of the opcodes I've faced a problem of implementing display for my emulator. After some googling and reading I've decoded to give OpenGL a shot. And here's the problem - display information is stored as a 1 bit per pixel monochrome image in the last 256 bytes of CHIP-8 memory (memory is an uint8_t array of size 4096). Of course, I can create another array for storing display data in a more usable format (1 byte per pixel) and render it via OpenGL as a texture, but what I want to know is if there are more elegant and efficient solutions in modern OpenGL or others libraries/frameworks which can be used within the C programming language.
Thank you in advance.
P.S. English is not my mother tongue so error fixes would be appreciated.
With modern OpenGL you can use integer textures and use a 8 bit single channel image format. Then in the shader you divide the fast running coordinate by 8 to determine the texel and the remainder to select the bit, something like this in GLSL
texelFetch(texture, ivec2(texcoord.x/8, texcoord.y), 0).x &
(1 << texcoord.x%8) != 0;
I'm currently on mobile, so please excuse if this is too concise. If you need more details, ask for it!

Extraction motion vectors from H.264 bitstream [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I'm looking for an open-source tool/code or some guidance to extract the motion vectors (MVs) of a H.264 encoded bit sequence. I'm already aware that motion vectors can be visualized using ffmpeg with the following command:
ffplay -flags2 +export_mvs input.mp4 -vf codecview=mv=pf+bf+bb
However, I want to produce a log file where the MVs of P and B frames are listed frame by frame. I checked out the structure of MVs from libavutil/motion_vector.h, but I couldn't find an example which shows how they are extracted and laid over the original sequence by ffplay. I thought that if I can find that out, I could possibly re-arrange the code to extract the MVs to a text file.
I also tried the code given in this answer, but it doesn't seem to work with the newer versions of ffmpeg:
I would appreciate any example codes or hints.
The source code for the codecview video filter is here, is that what you're looking for?
[edit] Sorry I guess that's not terribly helpful. The function you're looking for is filter_frame(), which shows you how to read AVMotionVectors (as side-data) from a given AVFrame, this is the code used in your commandline example. This example calls draw_arrow(), but you can simply replace that with a call to printf() or some custom function that logs the MV information to a logfile of your choosing.

strip certain character from lines in a textfile [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Closed 8 years ago.
Improve this question
I have a text file (generated by a script each week) with multiple lines, where I'd like to strip out certain characted, that differ each week. The files can look something like this;
Community S05E05 Geothermal Escapism SD TV.avi
Community S05E02 Introduction to Teaching SD TV.mp4
Supernatural S09E12 Sharp Teeth SD TV.avi
Elementary S02E11 Internal Audit SD TV.mp4
What I want removed is the season/episode numbering, and the quality and filetype. How to do this on a synology machine (busybox linux).
Given the comment you posted about a perl solution, it sounds like this is all you need:
$ awk '{$2="-";NF-=2}1' file
Community - Geothermal Escapism
Community - Introduction to Teaching
Supernatural - Sharp Teeth
Elementary - Internal Audit

Resources