がんばって英語で書くブログ
英語勉強中なので、ブログも英語で書こうかと。
スポンサーサイト
上記の広告は1ヶ月以上更新のないブログに表示されています。
新しい記事を書く事で広告が消せます。

Japanese test
I took it.
that result was 51(16/30) points, no wonder.
actually, I could get good score as much as I expected :-)






テーマ:英語日記 - ジャンル:学問・文化・芸術

bug fix
I read main-menu.c (it's one of d-i components) this afternoon. I found a memory leak bug.
so I wrote a patch then send a bug report with the patch.
the patch was accepted. so it's my pleasure:-)


テーマ:英語日記 - ジャンル:学問・文化・芸術

GTK+ studying11
This is GTK+ memo. using label and fork(), pipe().


#include <gtk/gtk.h>

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

static gchar *get_uname(void)
{
int fd[2];

pid_t pid;
char buf[256];
gchar *p = NULL;

memset(buf, 0, sizeof(buf));

pipe(fd);

if ((pid = fork()) == -1)
perror("fork()");

if (pid == 0) { /* chiled */
dup2(fd[1], 1);

close(fd[0]);
close(fd[1]);

execl("/bin/uname", "uname", "-sr", NULL);
_exit(0);
} else {
close(fd[1]);

read(fd[0], &buf, sizeof(buf) - 1);
p = g_strdup(buf);
}

return p;
}

static gboolean button_clicked(GtkWidget *widget,
gpointer data)
{
GtkWidget *label = (GtkWidget *) data;
gchar *p = get_uname();

gtk_label_set_text(GTK_LABEL(label), p);
g_free(p);

return FALSE;
}

static GtkWidget *create_button(void *data)
{
GtkWidget *button;

button = gtk_button_new_with_label("ok");
g_signal_connect(G_OBJECT(button), "clicked",
G_CALLBACK(button_clicked), data);

return button;
}

void create_window(void)
{
GtkWidget *window;
GtkWidget *vbox1;
GtkWidget *vbox2;
GtkWidget *button;
GtkWidget *separator;
GtkWidget *label;

window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_title(GTK_WINDOW(window), "label test");

gtk_container_set_border_width(GTK_CONTAINER(window), 5);
g_signal_connect(G_OBJECT(window), "destroy",
G_CALLBACK(gtk_main_quit), NULL);

vbox1 = gtk_vbox_new(FALSE,0);
vbox2 = gtk_vbox_new(FALSE, 0);

label = gtk_label_new("default text");

gtk_box_pack_start(GTK_BOX(vbox1), label, TRUE, TRUE, 0);
gtk_widget_set_size_request(GTK_WIDGET(label), 180, 200);

gtk_widget_show(label);

gtk_container_add(GTK_CONTAINER(window), vbox1);
gtk_widget_show(vbox1);

separator = gtk_hseparator_new();
gtk_box_pack_start(GTK_BOX(vbox1), separator, FALSE, TRUE, 0);
gtk_widget_show(separator);

button = create_button(label);
gtk_box_pack_start(GTK_BOX(vbox2), button, TRUE, TRUE, 0);
gtk_widget_show(button);

gtk_container_add(GTK_CONTAINER(vbox1), vbox2);
gtk_widget_show(vbox2);

gtk_widget_show(window);

}

int main(int argc, char **argv)
{
gtk_init(&argc, &argv);

create_window();

gtk_main();

return 0;
}


テーマ:英語日記 - ジャンル:学問・文化・芸術

cats and credit card
According to this
.
That would be funny if there could get a credit card:-)
if she didn't tell truth, cat got it.
then, her cat buy cats food at super market. of course she use her credit card:-)



テーマ:英語日記 - ジャンル:学問・文化・芸術

trial lession
I went to some English school to take a trial lesson.
I had level check test, lesson and so on.
That test's result was not bad. btw, if I spoke English every day I could get more good result.
anyway, lesson was good also lesson fee is _very_ important.
so I can't decide yet.

maybe I'll take another school's trial lesson then I'll decide school.


テーマ:英語日記 - ジャンル:学問・文化・芸術



上記広告は1ヶ月以上更新のないブログに表示されています。新しい記事を書くことで広告を消せます。