Thursday, June 12, 2014

Netty (2)

Yesterday I started  netty becasue of trying to make game server

And I read the article why multi networking program recommend netty

yeseter day i Make chatting source and

what i made are below list

This is My Chat JavaAPI

id:id  
= Make User Id

s:room_seq:message 
=  Write message in special room

m:name 
= make room and write name
mo: 
= out room

in:room_seq 
= enter the chat room

bye: 
= exit chatting

sh: 
= show user
sr : 
= user room


and I will make more apis

which are queries like general database

My Finall purpose is make rooms when admin want to make and

all around people can access rooms if they download Android application.

after completion of chatting server,
I will open API and source for you guys and relasese for free.

Wednesday, June 11, 2014

Netty ~ (1)

Today I start to study Netty

this is well-known for networking program like chatting or game server and so on

this is NIO means non blocking

and I will write what i learn from netty~

expect ~~ haha


Tuesday, June 10, 2014

First time to use jenkins, this is basic test set up in localhost

what tools for java I use are maven, eclipse, em.. no more

So I want to automate build enviroment of web deployment

google and java magazine tell me that using Jenkins is good

For future big project, I try to set up jenkins in my window local computer.

I will use it somewhile and tell you adventage and disadventage~!

Monday, June 9, 2014

sample json data maker

I recommend you this homepage if you want to make sample Json data

Thursday, May 29, 2014

jquery.circle.all.js

this plugin will make your homepagebackground changed in duration.

Wednesday, May 28, 2014

SRM 521 DIV 1


 

MySolution 


public class MissingParentheses {
  
    int  missingNumber;
  
    public int countCorrections(String str){
        int leftCnt = 0;
        for(int i=0; i<str.length(); i++){
            if(str.charAt(i) == '('){
                leftCnt++;
            }else{
                if(leftCnt <=0){
                    missingNumber++;
                }else{
                    leftCnt--;
                }
            }
        }
        return leftCnt + missingNumber;
    }
}

 Problem Statement

     Given a string of parentheses, you must turn it into a well formed string by inserting as few parentheses as possible, at any position (you cannot delete or change any of the existing parentheses).
A well formed string of parentheses is defined by the following rules:
  • The empty string is well formed.
  • If s is a well formed string, (s) is a well formed string.
  • If s and t are well formed strings, their concatenation st is a well formed string.
As examples, "(()())", "" and "(())()" are well formed strings and "())(", "()(" and ")" are malformed strings. Given a String par of parentheses, return the minimum number of parentheses that need to be inserted to make it into a well formed string.

Definition

    
Class: MissingParentheses
Method: countCorrections
Parameters: String
Returns: int
Method signature: int countCorrections(String par)
(be sure your method is public)

Limits

    
Time limit (s): 2.000
Memory limit (MB): 64

Constraints

- par will contain between 1 and 50 characters, inclusive.
- Each character of par will be an opening or closing parenthesis, i.e., '(' or ')'.

Examples

0)
    
"(()(()"
Returns: 2
The string below is a possible well formed string you can get to by inserting the two closing parentheses marked.
(())(())
   ^   ^
1)
    
"()()(()"
Returns: 1
You can fix the string by inserting a single closing parenthesis at the end.
2)
    
"(())(()())"
Returns: 0
The input string is well formed, so no insertion is needed.
3)
    
"())(())((()))))()((())))()())())())()()()"
Returns: 7
This problem statement is the exclusive and proprietary property of TopCoder, Inc. Any unauthorized use or reproduction of this information without the prior written consent of TopCoder, Inc. is strictly prohibited. (c)2003, TopCoder, Inc. All rights reserved. 

Thursday, May 22, 2014

Using LazyLoad when you feel that you website is so so slow ~

Today I introduce Lazyload library that is made in javascript

basic pattern in html looks like below~

html
body
head
   script src='download.js'
   script src='hello.js'
 
/head
body
    div
    /div
/body
/html

if you call this webpage, you can see the fully loaded website after fully loading script and html tags,

that is html logic sequences, first script, second script, third script so on...
second script will be called after first script.

so if the website is huge or there are many script to be loaded.
people should wait more than they expected.


This Lazyload will make webpage fater than we think.

because we can controll to call scripts dynamically.

summary

1. dynamically loading script
2. script dependency
3. speed up when first website show