LINUX.ORG.RU

Сообщения arssenia

 

Проблема с установкой Cinnamon в Gentoo

Добрый день! Столкнулся с проблемой при установке Cinnamon на Gentoo Установил базовую систему, при попытке установить Cinnamon выдает эту тарабарщину:

!!! The ebuild selected to satisfy ">=gnome-extra/cinnamon-session-3.6" has unmet requirements.
- gnome-extra/cinnamon-session-3.6.1-r5::gentoo USE="ipv6 -doc -elogind -systemd" ABI_X86="(64)"

The following REQUIRED_USE flag constraints are unsatisfied:
exactly-one-of ( elogind systemd )

dependency required by "gnome-extra/cinnamon-session-3.6.1-r5::gentoo" [ebuild])
dependency required by "gnome-extra/cinnamon" [argument])

Может быть, кто сталкивался?

 , ,

arssenia
()

Система тестирования студентов.

Кто знает, есть ли какие-нибудь открытые системы тестирования студентов написанные на python/django, либо каком-нибудь другом фреймворке (flask, bottle.py и т.д) ?

 , , , ,

arssenia
()

Разработка своего shell'a

Добрый день!
Помогите люди добрые полному нубу в программинге!
Короче, есть небольшая программа - shell. Вот ее код:

#include <sys/types.h>
#include <sys/stat.h>
#include <sys/wait.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <dirent.h>
#include <unistd.h>
#define MAXLINE 256
#define MAXPATH 256
#define MAXARGS 25
#define HASHSIZE 101
struct hashList {
    struct hashList *next;
    char *szCommand;
    char *szFullPath;
};
static struct hashList *hashTable[HASHSIZE];
/* hash:  form hash value for a command name */
unsigned hash(char *szCommand) {
    int i=0, sum=0;
    while(szCommand[i]) sum += szCommand[i++];
    return sum % HASHSIZE;
}
/* hashFind:  find command in hash table */
struct hashList *hashFind(char *szCommand) {
    struct hashList *hp;
    for(hp=hashTable[hash(szCommand)]; hp !=NULL; hp=hp->next)       
        if(strcmp(szCommand, hp->szCommand)==0) return hp;
    return NULL;    /* not found */
}
/* hashInsert:  insert command and path in hash table */
struct hashList *hashInsert(char *szCommand, char *szFullPath) {
    struct hashList *hp;
    unsigned hashVal;
    if((hp=hashFind(szCommand))==NULL) {  /* not found */
        hp=(struct hashList *)malloc(sizeof(*hp));
        if(hp==NULL || (hp->szCommand = strdup(szCommand))==NULL
           || (hp->szFullPath = strdup(szFullPath))==NULL)
               return NULL;    /* Couldn't add the hash entry */
        hashVal=hash(szCommand);
        hp->next = hashTable[hashVal];
        hashTable[hashVal]=hp;
    }
    return hp;
}
int main() {
    const char *szPrompt = "msh> ";
    char sInputBuf[MAXLINE];
    char szFilePath[MAXPATH];
    char *szDirPath;
    char *szEnvPath=strdup(getenv("PATH"));
    char *szCommand;
    char *szArgs[MAXARGS];
    DIR *dp;
    struct dirent *d;
    struct stat statBuf;
    struct hashList *hp;
    int i, status;
    pid_t pid;
    /* Scan PATH directories and add commands to hash table */
    szDirPath=strtok(szEnvPath, ":");
    while( szDirPath != NULL ) {
        if((dp=opendir(szDirPath)) != NULL) {
            while((d=readdir(dp))) {
                if(d->d_ino != 0) {
                    strcpy(szFilePath, szDirPath);
                    strcat(szFilePath, "/");
                    strcat(szFilePath, d->d_name);
                    if(lstat(szFilePath, &statBuf) >= 0)
                        if(S_ISREG(statBuf.st_mode) && access(szFilePath,X_OK)==0)
                            hashInsert(d->d_name, szFilePath);
                }
            }
            closedir(dp);
        }
        szDirPath = strtok(NULL, ":");
    }
    /* Get commands until Ctrl-D */
    fputs(szPrompt, stdout);                 /* Prompt for command input */
    while( fgets(sInputBuf, MAXLINE, stdin) != NULL ) {
        /* Parse command line arguments */
        szArgs[i=0] = strtok(sInputBuf, " \n");
        while( i<MAXARGS && szArgs[i] != NULL ) szArgs[++i] = strtok(NULL, " \n");
        if(szArgs[0] == NULL) szCommand = NULL;
        else {     /* Find path to command */
            if(strchr(szArgs[0], '/') != NULL) szCommand=szArgs[0];  /* path given */
            else {   /* look up full command path in hash table */
                if((hp=hashFind(szArgs[0])) != NULL) {                
                    szCommand=hp->szFullPath;
                } else {
                    szCommand = NULL;
                    fprintf(stderr, "%s: command not found.\n", szArgs[0]);
                }
            }
        }
        if(szCommand != NULL) {
            /* Fork and execute command, wait for completion */
            if((pid=fork()) < 0) {            /* Error */
                perror("Error in fork()");
                exit(1);
            } else if(pid == 0) {   /* run command in child process */
                execv(szCommand, szArgs);
                /* Reach here only if the command would not exec */
                perror(szCommand);    
                exit(1);
            }
            if(waitpid(pid, &status, 0) == -1) {
                perror("Error in waitpid()");
                exit(1);
            }
        }
        fputs(szPrompt, stdout);  /* Prompt for next command */
    }
    fputc('\n', stdout);
    return 0;
}

Что сюда нужно добавить, чтобы shell реагировал на команды?
Например, при вводе команды exit, shell прекращает работу.
Если кто знает, подскажите, пожалуйста.

 ,

arssenia
()

Тем дипломной работы

Всем доброго времени суток! Нужен совет.
Заканчиваю институт по специальности АСОИУ. Время выбирать тему дипломной работы. Никак не могу подобрать подходящую. Думаю, взять либо что-нибудь связанное с БД, либо компьютерная графика/дизайн.
Есть на лоре, кто заканчивал институт по этой специальности?
Помогите определиться, буду рад любым идеям и предложениям!

 , , ,

arssenia
()

Помогите, пожалуйста, с fork()

Добрый вечер! Возник вопрос. Как можно создать несколько дочерних процессов при этом их кол-во бы задавалось аргументом из командной строки?

Все что надумал:

#include <sys/types.h>
#include <unistd.h>
#include <stdio.h>

int main(int argc, char **argv)
{
	fork();
	return 0;
}

т.е. ничего, ибо в программинге не силен. В приведенном выше примере понятно, что создается один процесс...

 ,

arssenia
()

Сеть в Thunar

Добрый день!
В thunar на боковой панели в закладках не отображется точка входа в сеть. Например, в Xubuntu такая точка входа есть «из коробки». Кто-нибудь знает как решить данную проблему?
P.S. Использую Debian.

 ,

arssenia
()

Посоветуйте модули/технологии python для реализации простой ИС.

Добрый день! Необходимо создать простую информационную систему для работы внутри сети, а именно — БД, часть, которая работает с БД и клиентская часть на основе web-технологий.

Т.е., сама система и БД будет находится отдельно на сервере, а на клиентских компьютерах — web-интерфейс. Язык программирования - Python.

Интересуют следующие вопросы:

1) Каким образом можно реализовать web-интерфейс, какие модули питона для этого лучше использовать?

2) БД, думаю, выбрать MySQL либо PostgreSQL. Что посоветуете?

3) Есть ли примеры/open source проекты подобного рода?

4) Возможно, есть еще какие-либо нюансы... ?

UPD.: Хотелось бы как можно проще. Без всяких фреймворков типа Django и т.д...

 ,

arssenia
()

RSS подписка на новые темы