MI 11 SPECIFICATION



MI 11


Xiaomi Mi 11 smartphone was launched on 28th December 2020. The phone comes with a 6.81-inch touchscreen display with a resolution of 1440x3200 pixels at a pixel density of 515 pixels per inch (ppi) and an aspect ratio of 20:9. Xiaomi Mi 11 is powered by an octa-core Qualcomm Snapdragon 888 processor. It comes with 8GB of RAM. The Xiaomi Mi 11 runs Android 11 and is powered by a 4,600mAh non-removable battery. The Xiaomi Mi 11 supports wireless charging, as well as proprietary fast charging.
 
 
 
 
type line

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define MAX_COMMAND_LENGTH 100
#define MAX_ARGUMENTS 10

void executeCommand(char* command) {
    int i = 0;
    char* args[MAX_ARGUMENTS];
    char* token = strtok(command, " \t\n");

    while (token != NULL) {
        args[i++] = token;
        token = strtok(NULL, " \t\n");
    }
    args[i] = NULL;

    if (strcmp(args[0], "typeline") == 0) {
        if (args[1] == NULL) {
            printf("Error: Insufficient arguments for typeline command.\n");
            return;
        }

        FILE* file = fopen(args[2], "r");
        if (file == NULL) {
            printf("Error: Failed to open the file '%s'.\n", args[2]);
            return;
        }

        char line[256];
        int lineCount = 0;

        if (strcmp(args[1], "+") == 0) {
            if (args[2] == NULL) {
                printf("Error: Insufficient arguments for typeline command.\n");
                fclose(file);
                return;
            }

            int numLines = atoi(args[2]);
            while (fgets(line, sizeof(line), file) != NULL && lineCount < numLines) {
                printf("%s", line);
                lineCount++;
            }
        } else if (strcmp(args[1], "-") == 0) {
            if (args[2] == NULL) {
                printf("Error: Insufficient arguments for typeline command.\n");
                fclose(file);
                return;
            }

            int numLines = atoi(args[2]);
            int totalLines = 0;
            while (fgets(line, sizeof(line), file) != NULL) {
                totalLines++;
            }

            fseek(file, 0, SEEK_SET);
            int startLine = totalLines - numLines;
            lineCount = 0;
            while (fgets(line, sizeof(line), file) != NULL && lineCount < totalLines) {
                if (lineCount >= startLine) {
                    printf("%s", line);
                }
                lineCount++;
            }
        } else if (strcmp(args[1], "a") == 0) {
            while (fgets(line, sizeof(line), file) != NULL) {
                printf("%s", line);
            }
        } else {
            printf("Error: Invalid typeline command.\n");
        }

        fclose(file);
    } else {
        pid_t pid = fork();
        if (pid < 0) {
            printf("Error: Failed to fork.\n");
            return;
        } else if (pid == 0) {
            // Child process
            if (execvp(args[0], args) == -1) {
                printf("Error: Failed to execute the command '%s'.\n", args[0]);
            }
            exit(0);
        } else {
            // Parent process
            wait(NULL);
        }
    }
}

int main() {
    char command[MAX_COMMAND_LENGTH];

    while (1) {
        printf("NewShell$ ");
        if (fgets(command, sizeof(command), stdin) == NULL) {
            printf("\n");
            break;
        }
        executeCommand(command);
    }

    return 0;
}
 

 

 

count

 

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/wait.h>

#define MAX_COMMAND_LENGTH 100

void executeCommand(char *command) {
    // Tokenize the command
    char *token = strtok(command, " \t\n");

    // Check for special commands
    if (strcmp(token, "count") == 0) {
        token = strtok(NULL, " \t\n");

        if (token == NULL) {
            printf("Missing file name for 'count' command\n");
            return;
        }

        FILE *file = fopen(token, "r");
        if (file == NULL) {
            printf("File not found: %s\n", token);
            return;
        }

        char ch;
        int charCount = 0, wordCount = 0, lineCount = 0;
        int insideWord = 0;

        while ((ch = fgetc(file)) != EOF) {
            charCount++;

            if (ch == ' ' || ch == '\t' || ch == '\n') {
                insideWord = 0;
            } else if (insideWord == 0) {
                insideWord = 1;
                wordCount++;
            }

            if (ch == '\n') {
                lineCount++;
            }
        }

        fclose(file);

        token = strtok(NULL, " \t\n");
        if (token != NULL) {
            if (strcmp(token, "c") == 0) {
                printf("Character count: %d\n", charCount);
            } else if (strcmp(token, "w") == 0) {
                printf("Word count: %d\n", wordCount);
            } else if (strcmp(token, "l") == 0) {
                printf("Line count: %d\n", lineCount);
            } else {
                printf("Invalid count option: %s\n", token);
            }
        } else {
            printf("Missing count option for 'count' command\n");
        }
    } else {
        pid_t pid = fork();

        if (pid == -1) {
            printf("Fork failed\n");
            return;
        } else if (pid == 0) {
            // Child process
            execlp(command, command, NULL);
            printf("Command not found: %s\n", command);
            exit(1);
        } else {
            // Parent process
            wait(NULL);
        }
    }
}

int main() {
    char command[MAX_COMMAND_LENGTH];

    while (1) {
        printf("NewShell$ ");
        fgets(command, MAX_COMMAND_LENGTH, stdin);

        // Remove newline character
        command[strcspn(command, "\n")] = '\0';

        if (strcmp(command, "exit") == 0) {
            break;
        }

        executeCommand(command);
    }

    return 0;
}
 

 

list

 

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <dirent.h>
#include <sys/stat.h>
#include <sys/types.h>

#define MAX_COMMAND_LENGTH 100

void executeCommand(char *command) {
    // Tokenize the command
    char *token = strtok(command, " \t\n");

    // Check for special commands
    if (token != NULL && strcmp(token, "list") == 0) {
        token = strtok(NULL, " \t\n");

        if (token == NULL) {
            printf("Missing option for 'list' command\n");
            return;
        }

        if (strcmp(token, "f") == 0) {
            // Print name of all files in the directory
            DIR *dir;
            struct dirent *entry;

            dir = opendir(".");
            if (dir == NULL) {
                printf("Unable to open directory\n");
                return;
            }

            while ((entry = readdir(dir)) != NULL) {
                if (entry->d_type == DT_REG) {
                    printf("%s\n", entry->d_name);
                }
            }

            closedir(dir);
        } else if (strcmp(token, "n") == 0) {
            // Print number of all entries in the directory
            DIR *dir;
            struct dirent *entry;
            int count = 0;

            dir = opendir(".");
            if (dir == NULL) {
                printf("Unable to open directory\n");
                return;
            }

            while ((entry = readdir(dir)) != NULL) {
                count++;
            }

            closedir(dir);

            printf("Number of entries: %d\n", count);
        } else if (strcmp(token, "i") == 0) {
            // Print name and inode of all files in the directory
            DIR *dir;
            struct dirent *entry;
            struct stat fileStat;

            dir = opendir(".");
            if (dir == NULL) {
                printf("Unable to open directory\n");
                return;
            }

            while ((entry = readdir(dir)) != NULL) {
                if (entry->d_type == DT_REG) {
                    if (stat(entry->d_name, &fileStat) == 0) {
                        printf("Name: %s, Inode: %ld\n", entry->d_name, fileStat.st_ino);
                    }
                }
            }

            closedir(dir);
        } else {
            printf("Invalid option for 'list' command\n");
        }
    } else {
        pid_t pid = fork();

        if (pid == -1) {
            printf("Fork failed\n");
            return;
        } else if (pid == 0) {
            // Child process
            execlp(command, command, NULL);
            printf("Command not found: %s\n", command);
            exit(1);
        } else {
            // Parent process
            wait(NULL);
        }
    }
}

int main() {
    char command[MAX_COMMAND_LENGTH];

    while (1) {
        printf("NewShell$ ");
        fgets(command, MAX_COMMAND_LENGTH, stdin);

        // Remove newline character
        command[strcspn(command, "\n")] = '\0';

        if (strcmp(command, "exit") == 0) {
            break;
        }

        executeCommand(command);
    }

    return 0;
}
 

 
As far as the cameras are concerned, the Xiaomi Mi 11 on the rear packs a 108-megapixel primary camera with an f/1.85 aperture and a pixel size of 0.8-micron; a second 13-megapixel camera with an f/2.4 aperture and a third 5-megapixel camera with an f/2.4 aperture. The rear camera setup has autofocus. It sports a 20-megapixel camera on the front for selfies, with an f/2.4 aperture.
The Xiaomi Mi 11 runs MIUI 12 based on Android 11 and packs 128GB of inbuilt storage. The Xiaomi Mi 11 is a dual-SIM (GSM and GSM) smartphone that accepts Nano-SIM and Nano-SIM cards. The Xiaomi Mi 11 measures 164.30 x 74.60 x 8.06mm (height x width x thickness) and weighs 196.00 grams. It was launched in Anti-glare frosted glass: Midnight Gray, Horizon Blue, Frost White Vegan leather: Lilac Purple, and Honey Beige colours. It bears a glass body.
Connectivity options on the Xiaomi Mi 11 include Wi-Fi 802.11 a/b/g/n/ac/Yes, GPS, Bluetooth v5.20, NFC, USB Type-C, 3G, and 4G (with support for Band 40 used by some LTE networks in India). Sensors on the phone include accelerometer, ambient light sensor, compass/ magnetometer, gyroscope, proximity sensor, and in-display fingerprint sensor. The Xiaomi Mi 11 supports face unlock.
This specification is according to china, because this phone is launch in china
This phone is world powerfull smart phone.
& slimmest phone

Post a Comment

0 Comments

Read more: http://advanceandaccurate.blogspot.com/2012/04/anti-copy-script-for.html#ixzz6YAlJfvUk Under Creative Commons License: Attribution Non-Commercial No Derivatives