I need to write a script which will launch a video in full-screen mode every 2 hours and then close the video and proceed as normal. Questions:
1) What do I need to know to do that if the video-player is Windows Media Player (standard, Win7)? Should I read about it's API or public functions/classes somewhere?
2) What should I write it on? C#, any other language? Shall it be a permanently run console app?
/dpt/ - Daily Programming Thread
You can probably do it in a few lines with powershell. All you need is a loop with a timer. It opens mediaplayer and sends it a fullscreen signal and later kill signal. You don't need any APIs for this at all, just a tiny script with any language.
Can anyone help me figure this nonsense out? I'm trying to parse a text file line by line and store each line in a variable in C but I keep running into issues. I'm use fgets to read the file and sscanf to do shit line by line.
while(fgets(BUFFER, sizeof(BUFFER), file) != NULL){
sscanf(BUFFER, "%s", firstLine);
//I've tried sccanf(BUFFER, "%s[^\n]", firstLine), but it just adds every first char/string before spacing
}
I just have no clue how to read a line, add it to a variable, and then do the next line until we're at the end of the file. Google is giving me nothing.
#include
#include
#include
#undef RAND_MAX
#define RAND_MAX 10
struct point_archetype
{
unsigned int X_point;
unsigned int Y_point;
}point;
point.X_point = 0;
point.Y_point = 0;
struct line_archetype
{
struct point A;
struct point B;
};
typedef struct point_archetype POINT;
typedef struct line_archetype LINE;
struct figure_trilateral
{
LINE AB;
LINE CD;
LINE EF;
};
POINT define_point(unsigned int,unsigned int);
POINT define_point(unsigned int x,unsigned int y)
{
POINT location;
location.X_point = x;
location.Y_point = y;
return location;
}
LINE define_line(POINT,POINT);
LINE define_line(POINT A,POINT B);
{
LINE AB;
AB.A = A;
AB.B = B;
return AB;
}
unsigned int compute_distance(POINT,POINT);
unsigned int compute_distance(POINT w,POINT x)
{
unsigned int x_of_w = w.X_point;
unsigned int y_of_w = w.Y_point;
unsigned int x_of_x = x.X_point;
unsigned int y_of_x = x.Y_point;
unsigned int a = x_of_x - x_of_w;
unsigned int b = y_of_x - y_of_x;
unsigned int c = (a * a) + (b * b);
return c;
}
int main()
{
unsigned int points;
unsigned int generic;
const unsigned int pointss;
unsigned int points_list_index;
unsigned int bound_X = 10;
unsigned int bound_Y = 10;
unsigned int X_position = 0;
unsigned int Y_position = 0;
printf("Enter number of points to create:");
scanf("%u",&points);
pointss = points;
putchar('\n');
POINT* space = (POINT*)malloc(sizeof(point)*bound_X*bound_Y/*(*bound_Z)*/);
POINT* points_list = (POINT*)calloc(sizeof(point)*10,sizeof(point));
memset(space,0,sizeof(point)*bound_X*bound_Y);
while (points-- > 0)
{
X_position = rand();
Y_position = rand();
*(space+X_position+(Y_position*bound_Y)) = define_point(X_position,Y_position);
}
free(space);
}
Come on, it's not that hard. Google "c read a file" and open the first stack overflow link.
Went full autism and did fp16 and int8 inference on object detection. sub millisecond inference time lmao
>fgets(BUFFER, sizeof(BUFFER), file)
you're sizeof()'ing a char pointer and putting it into an int
set it as an upper bound or -1
I want to learn Forth, is it worth it?
Thank you, user, I will start learning how to work with Powershell rn.
I can kill those bots faster without a cheat????????
dogshit