Skip to content

Commit

Permalink
penpong blog!
Browse files Browse the repository at this point in the history
  • Loading branch information
dusdjhyeon committed Aug 27, 2022
1 parent bad858c commit eecfa5d
Show file tree
Hide file tree
Showing 183 changed files with 2,965 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions .idea/my_diary_blog.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

171 changes: 171 additions & 0 deletions _media/diary/files/2022/03/18/2020105586_김나현_Lab12.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
#include <iostream>
#include <string>
#include "Text.h"
#include "FancyText.h"
#include "FixedText.h"
using namespace std;

/* 기초 1번 문제
class Base {
protected: //Base type
void print_base() { cout << "Base" << endl; }
};
class Derived : private Base {
public:
void print_derived() {
Base::print_base();
cout << "Derived" << endl;
}
};
int main() {
Base base;
Derived derived;
derived.print_derived();
return 0;
}
*/

/* 기초 2~3번 문제
int main() {
Text t1("Plain");
t1.append("A");
cout << t1.get() << endl;
FancyText t2("Fancy", "<<", ">>", "***");
t2.append("A");
cout << t2.get() << endl;
FixedText t3;
t3.append("A");
cout << t3.get() << endl;
t1 = t2;
return 0;
}
*/

/* 응용 1번 문제
class Polygon {
public:
Polygon() {}
Polygon(int point, float length) {
mPoint = point;
mLength = length;
}
~Polygon() {}
virtual void calcPerimeter() { cout << "Perimeter: empty" << endl; }
virtual void calcArea() { cout << "Area: empty" << endl; }
protected:
int mPoint;
double mLength;
};
class Rectangle : public Polygon {
public:
Rectangle() {}
Rectangle(int point, float length) : Polygon(point, length) {}
~Rectangle() {}
void calcPerimeter() override { cout << "Perimeter: " << mPoint * mLength << endl; }
void calcArea() override { cout << "Area: " << mLength * mLength << endl; }
};
int main() {
Polygon pol;
Rectangle rec(4, 10);
cout << "--- Polygon class ---" << endl;
pol.calcPerimeter();
pol.calcArea();
cout << "--- Rectangle class ---" << endl;
rec.calcPerimeter();
rec.calcArea();
return 0;
}
*/

/* 응용 2번 문제
class Polygon {
public:
Polygon() {}
Polygon(int point, float length) {
mPoint = point;
mLength = length;
}
~Polygon() {}
virtual void calcPerimeter() { cout << "Perimeter: empty" << endl; }
virtual void calcArea() { cout << "Area: empty" << endl; }
protected:
int mPoint;
double mLength;
};
class Rectangle : public Polygon {
public:
Rectangle() {}
Rectangle(int point, float length) : Polygon(point, length) {}
~Rectangle() {}
void calcPerimeter() override { cout << "Perimeter: " << mPoint * mLength << endl; }
void calcArea() override { cout << "Area: " << mLength * mLength << endl; }
};
class Triangle : public Polygon {
public:
Triangle() {}
Triangle(int point, float length) : Polygon(point, length) {}
~Triangle() {}
void calcPerimeter() override { cout << "Perimeter: " << mPoint * mLength << endl; }
void calcArea() override { cout << "Area: " << mLength * 0.5 * sqrt(3) * mLength * 0.5 << endl; }
};
class Circle : public Polygon {
public:
Circle() {}
Circle(int point, float length) : Polygon(point, length) {}
~Circle() {}
void calcPerimeter() override { cout << "Perimeter: " << 2 * 3.14 * mLength << endl; }
void calcArea() override {
cout << "Area: " << 3.14 * mLength * mLength << endl;
}
};
int main() {
Triangle tri(3, 10);
Rectangle rec(4, 10);
Circle cir(0, 5);
cout << "--- Triangle class ---" << endl;
tri.calcPerimeter();
tri.calcArea();
cout << "--- Rectangle class ---" << endl;
rec.calcPerimeter();
rec.calcArea();
cout << "--- Circle class ---" << endl;
cir.calcPerimeter();
cir.calcArea();
return 0;
}
*/

class Train {
public:
Train() {}
Train(int people) { mPeople = 0; }
~Train() {}
virtual int station(int takeOff, int takeOn) {}
protected:
int mPeople;
};
class Ktx : public Train {
public:
Ktx() : Train(0) {}
Ktx(int people) : Train(people) {}
~Ktx() {}
};

Binary file added _media/diary/files/2022/04/03/스크린샷1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _media/diary/images/2022/03/18/zzang.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _media/diary/images/2022/04/03/스크린샷1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _media/diary/images/2022/07/14/스크린샷1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _media/diary/images/2022/07/18/cotaro.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _media/diary/images/2022/07/19/다운로드.webp
Binary file not shown.
Binary file added db.sqlite3
Binary file not shown.
Empty file added diary/__init__.py
Empty file.
Binary file added diary/__pycache__/__init__.cpython-39.pyc
Binary file not shown.
Binary file added diary/__pycache__/admin.cpython-39.pyc
Binary file not shown.
Binary file added diary/__pycache__/apps.cpython-39.pyc
Binary file not shown.
Binary file added diary/__pycache__/models.cpython-39.pyc
Binary file not shown.
Binary file added diary/__pycache__/urls.cpython-39.pyc
Binary file not shown.
Binary file added diary/__pycache__/views.cpython-39.pyc
Binary file not shown.
5 changes: 5 additions & 0 deletions diary/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from django.contrib import admin
from .models import Post,Guest

admin.site.register(Post)
admin.site.register(Guest)
6 changes: 6 additions & 0 deletions diary/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from django.apps import AppConfig


class DiaryConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'diary'
26 changes: 26 additions & 0 deletions diary/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Generated by Django 4.0.3 on 2022-03-28 16:47

from django.db import migrations, models


class Migration(migrations.Migration):

initial = True

dependencies = [
]

operations = [
migrations.CreateModel(
name='Post',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('title', models.CharField(max_length=30)),
('content', models.TextField()),
('head_image', models.ImageField(blank=True, upload_to='diary/images/%Y/%m/%d/')),
('file_upload', models.FileField(blank=True, upload_to='diary/files/%Y/%m/%d/')),
('created_at', models.DateTimeField(auto_now_add=True)),
('updated_at', models.DateTimeField(auto_now=True)),
],
),
]
25 changes: 25 additions & 0 deletions diary/migrations/0002_guest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Generated by Django 4.0.3 on 2022-04-29 16:16

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('diary', '0001_initial'),
]

operations = [
migrations.CreateModel(
name='Guest',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('content', models.TextField()),
('created_at', models.DateTimeField(auto_now_add=True)),
('author', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)),
],
),
]
18 changes: 18 additions & 0 deletions diary/migrations/0003_alter_guest_author.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 4.0.3 on 2022-04-29 16:25

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('diary', '0002_guest'),
]

operations = [
migrations.AlterField(
model_name='guest',
name='author',
field=models.CharField(max_length=20, null=True),
),
]
18 changes: 18 additions & 0 deletions diary/migrations/0004_guest_sticker.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 4.0.3 on 2022-05-20 16:35

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('diary', '0003_alter_guest_author'),
]

operations = [
migrations.AddField(
model_name='guest',
name='sticker',
field=models.CharField(max_length=100, null=True),
),
]
Empty file added diary/migrations/__init__.py
Empty file.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added diary/migrations/__pycache__/__init__.cpython-39.pyc
Binary file not shown.
37 changes: 37 additions & 0 deletions diary/models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
from django.db import models
import os

class Post(models.Model):
title = models.CharField(max_length=30)
content = models.TextField()

head_image = models.ImageField(upload_to='diary/images/%Y/%m/%d/', blank=True)
file_upload = models.FileField(upload_to='diary/files/%Y/%m/%d/', blank=True)
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)

def __str__(self):
return f'[{self.pk}]{self.title}'

def get_absolute_url(self):
return f'/diary/{self.pk}/'

def get_file_name(self):
return os.path.basename(self.file_upload.name)

def get_file_ext(self):
return self.get_file_name().split('.')[-1]



class Guest(models.Model):
author = models.CharField(null=True,max_length=20)
content=models.TextField()
created_at =models.DateTimeField(auto_now_add=True)
sticker=models.CharField(null=True, max_length=100)

def __str__(self):
return f'{self.author},{self.content}'

def get_absolute_url(self):
return f'/diary/guest_book/#guest-{self.pk}'
7 changes: 7 additions & 0 deletions diary/static/diary/bootstrap/bootstrap.min.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions diary/static/diary/bootstrap/bootstrap.min.css.map

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions diary/static/diary/css/avatar.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.avatar{
background-image:url('./images/main.png');
background-size:cover;
margin-top:-44px;
margin-left:-50px;
height:400px;
width:345px;
position:absolute;
}

.capture{
margin-top:90px;
margin-left:50px;
height:320px;
width:248px;
}
3 changes: 3 additions & 0 deletions diary/static/diary/css/blog-post.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
body {
padding-top: 35px;
}
Loading

0 comments on commit eecfa5d

Please sign in to comment.