Game, Programing, Mac OSX

Monday, September 28, 2009

ETC:Gartner Identifies the Top 10 Strategic Technologies for 2009

Original article from Gartner

1. Virtualization
2. Cloud Computing
3. Servers - Beyond Blades
4. Web-Oriented Architectures
5. EnterpriseMashups
6. Specialized Systems
7. Social Software and Social Networking
8. Unified Communications
9. Business Intelligence
10 Green IT

Wednesday, September 23, 2009

ACM:10098

http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=107&page=show_problem&problem=1039



#include <iostream>
#include <string>
#include <algorithm>

using namespace std;

int main()
{
int n;
string s;

cin >> n;
while(n--)
{
cin >> s;
sort(s.begin(), s.end());
do
{
cout << s << endl;
}while(next_permutation(s.begin(), s.end()));
cout << endl;
}

return 0;
}

ACM:10344

http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=108&page=show_problem&problem=1285




#include <iostream>
#include <algorithm>
#include <vector>

using namespace std;

bool is23;

void OutOf(int now, int* num, int sum);

int main()
{
int num[5];
bool finished = false;
while(1)
{
for(int i=0; i<5; i++)
{
cin >> num[i];
if(num[i] == 0)
finished = true;
else
finished = false;
}
if(finished)
break;

is23 = false;
sort<int*>(num, num+5);
do {
OutOf(0, num, num[0]);
if(is23)
{
cout << "Possible" << endl;
break;
}
} while(next_permutation<int*>(num, num+5));

if(!is23)
cout << "Impossible" << endl;

}

return 0;
}

void OutOf(int now, int* num, int sum)
{
if(is23 == true)
return;

if(now > 3)
{
if(sum == 23)
is23 = true;
return;
}

OutOf(now+1, num, sum+num[now+1]);
OutOf(now+1, num, sum-num[now+1]);
OutOf(now+1, num, sum*num[now+1]);

}

MFC: Fast Bitmap Block Transfer

CBitmapBltView.h
class CBitmapBltView : public CView
{
-----
public:
CBitmap m_Bitmap;
BITMAP m_Bmpinfo;
BOOL m_bBmpInit;
};


CBitmapBltView.cpp
void CBitmapBltView::OnDraw(CDC* pDC)
{
CBitmapBltDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
if (!pDoc)
return;

if (!m_bBmpInit) {
DWORD dwColor;
BYTE R,G,B;
for (int i=0; i<256; i++)
for (int j=0; j<256; j++)
pDC->SetPixelV(i,j,RGB(i,j,0));
LPDWORD buf = (LPDWORD)HeapAlloc(GetProcessHeap(), 0, 256*256*4);

for(int i=0; i<256; i++)
{
for(int j=0; j<256; j++)
{
dwColor = (DWORD) pDC->GetPixel(i,j);
G = (BYTE) dwColor;
B = (BYTE) (dwColor >> 8);
R = (BYTE) (dwColor >> 16);
buf[i*256+j] = (DWORD) RGB(R,G,B);
}
}
m_Bitmap.CreateBitmap(256,256,1,32,buf);
m_Bitmap.GetBitmap(&m_Bmpinfo);
m_bBmpInit = TRUE;
}
else
{
CDC dcmem;
dcmem.CreateCompatibleDC(pDC);
dcmem.SelectObject(&m_Bitmap);
pDC->StretchBlt(0,0, m_Bmpinfo.bmWidth, m_Bmpinfo.bmHeight, &dcmem, 0, 0, m_Bmpinfo.bmWidth, m_Bmpinfo.bmHeight, SRCCOPY);

}
}

Monday, September 14, 2009

ETC: How to reset the toner counter of Xerox DocuPrint 203A

If the yellow lamp(Toner) keeps on when you are using DocuPrint 203A, you can't print anymore.
But there should be toner left still in the cartridge, you need to reset the toner counter to use it.
(You can print more!!)

Follow this.
1. Open the front(Cartridge), while the printer is turned off.
2. While you press 'Go' button, turn on the printer.
3. Press 'Go' button twice. (When you press once, the green lamp turns on once)
4. Check 3 lamps('Toner', 'Drum', 'Paper') turns on.
5. Press 'G0' button 5 times.
6. Close the front.
7. You can find out the yellow lamp has turned on, after 'wing~' sound.

Friday, September 11, 2009

MFC: How to use radio buttons (Visual c++ 2008, WinXP)

1. Set radio buttons





2. Set tap sequence linear.






3. Set First radio buttons' 'Group' property is true













4. Make 'int' type, 'value' category member variable









5. Code using the member variable

Wednesday, September 09, 2009

2009 ACM-ICPC Preparing

1. Access http://icpc.baylor.edu
2. Login
3. Allow Professor Kim's invitation
4. Click 'Profile'
5. Edit 'Degree info'
6. Edit 'Extra Field' and Insert Korean name and ID Number

Followers