Code Monkey home page Code Monkey logo

study's People

Watchers

 avatar  avatar

study's Issues

데이터베이스

엑셀기능 + query

query 를 사용하여 특수한 정보만 취득하는게 가능.

노래의 database가 존재하는경우
ex) select 아티스트, 길이 from favorite LIMIT 2;

trying out mongoose.

mongoosetest.js

var mongoose = require('mongoose');

mongoose.connect('mongodb://localhost/myDb');

var db = mongoose.connection;

db.on('error', console.error.bind(console,'connection error:'));

db.once('open', function callback(){
console.log("open");
});

var userSchema = mongoose.Schema({
username: 'string',
age: 'number'
});

var User = mongoose.model('User', userSchema);

var user1 = new User({ username: 'redrock', age: 24});
var user2 = new User({ username: 'sjPark', age: 25});

user1.save(function(err,user1){
if(err)
console.log("error");
});

user2.save(function(err,user2){
if(err)
console.log("error");
});

// doesn't know why, but the data is duplicated when searched with db.users.find()

interactive graphic ls_01

include <GL\freeglut.h>

include

const float M_PI = 3.14592;
const float radians(float x){
return x*M_PI / 180.0;
}

//void mydisplay()
//{
// glClear(GL_COLOR_BUFFER_BIT);
// glBegin(GL_LINE_LOOP);
// GLfloat x = -0.8;
// GLfloat y = 0.4;
// for (int i = 0; i < 6; i++){
// glVertex2f(x, y);
// x += 0.3;
// y *= -1;
// }
// glEnd();
// glFlush();
//}

//void mydisplay()
//{
// glClear(GL_COLOR_BUFFER_BIT);
// GLfloat y;
// GLfloat w = 1;
// for (y = 0.8; y > -0.8; y -= 0.2){
// glLineWidth(w++);
// glBegin(GL_LINES);
//
// glVertex2f(-0.8, y);
// glVertex2f(0.8, y);
// glEnd();
// }
// glFlush();
//}

//void mydisplay()
//{
// glClear(GL_COLOR_BUFFER_BIT);
// glShadeModel(GL_SMOOTH);
// glBegin(GL_TRIANGLE_FAN);
// glColor3f(0.0, 1.0, 1.0);
// glVertex2f(0.0, 0.0);
// glVertex2f(0.0, 0.5);
// glVertex2f(-0.35, 0.35);
// glColor3f(1.0, 1.0, 0.0);
// glVertex2f(-0.5, 0.0);
// glColor3f(0.0, 1.0, 1.0);
// glVertex2f(-0.35, -0.35);
// glColor3f(1.0, 1.0, 0.0);
// glVertex2f(0.0, -0.5);
// glColor3f(0.0, 1.0, 1.0);
// glVertex2f(0.35, -0.35);
// glColor3f(1.0, 1.0, 0.0);
// glVertex2f(0.5, 0.0);
// glColor3f(0.0, 1.0, 1.0);
// glVertex2f(0.35, 0.35);
// glColor3f(1.0, 1.0, 0.0);
// glVertex2f(0.0, 0.5);
// glEnd();
// glFlush();
//}

void draw_sphere(){
float x, y, z;
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
glBegin(GL_TRIANGLE_STRIP);
for (float phi = -80.0; phi <= 80.0; phi _= 20.0){
float phir = radians(phi);
float phir20 = radians(phi_20.0);

}

}

/////////////////////////////////////////////////////////////////
void ellipse(float x, float y, float w, float h)
{
float dx, dy;
glBegin(GL_POLYGON);

for (int i = 0; i < 36; i++){
    float angle = radians(10.0*i);
    dx = w*cos(angle);
    dy = h*sin(angle);
    glVertex2f(x+dx, y+dy);
}
glEnd();

}

void mydisplay(){
glClear(GL_COLOR_BUFFER_BIT);

glColor3f(1.0, 1.0, 1.0);
glLineWidth(10.0);
glBegin(GL_LINE_LOOP);
glVertex2f(0.2, 0.2);
glVertex2f(-0.2, 0.2);
glVertex2f(-0.2, -0.8);
glVertex2f(0.2, -0.8);
glEnd();

glBegin(GL_LINES);
glVertex2f(-0.2, -0.8);
glVertex2f(-0.6, -1.0);

glVertex2f(0.2, -0.8);
glVertex2f(0.6, -1.0);
glEnd();

glColor3f(2.0, 0.0, 0.0);
glLineWidth(10.0);
glPolygonMode(GL_FRONT, GL_LINE);
ellipse(0.0, 0.3, 0.5, 0.5);

glColor3f(0.0, 0.0, 1.0);
glPolygonMode(GL_FRONT, GL_FILL);
ellipse(0.0, 0.3, 0.5, 0.5);

glColor3f(1.0, 0.6, 0.6);
glPolygonMode(GL_FRONT, GL_FILL);
ellipse(-0.3, 0.3, 0.2, 0.3);
ellipse(0.3, 0.3, 0.2, 0.3);



glFlush();

}

int main(int argc, char **argv){
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGBA);
glutInitWindowSize(1000, 1000);
glutInitWindowPosition(0, 0);
glutCreateWindow("asdf");
glutDisplayFunc(mydisplay);

glutMainLoop();
return 0;

}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.