Sunday, November 29, 2009

Add Model reference to View

In Model View Controller in the context of Cocoa, when View(PolygonView) needs a reference to Model(PolygonShape):
Step 1: declare an instance variable of PolygonShape in PolygonView



Step 2 Link the Outlet PolygonShape to Class PolygonShape

Thursday, October 15, 2009

#include vs #include "file"

First: <> vs ""
Both would work if file exist. The difference is the order of directories are searched.
In case of <>: ONLY searches in list of SYSTEM directories. If file does not exist in the system directories then C1083 error.

In case of "file": First searches in the including file directory(current file directory), if not found then searches in the SYSTEM directories. If either is found then C1083 error.

Second: file vs file.h
Some of the header files end with ".h" others do not. Eg stdio.h vs fstream .Both of the files are in system directory so proper inclusion would be
#include
#include

of course the following would work as well
#include "stdio"
#include "fstream.h"

See picture for more clarification example





verifies files are in system directory


ref:http://gcc.gnu.org/onlinedocs/cpp/Include-Syntax.html

Monday, September 14, 2009

proxy

Thursday, August 20, 2009

parameterized types are only available if is 5.0



This error turned out when I tried to use HashMap, the reason was the compiler compliance level. OS: Ubuntu

Wednesday, August 19, 2009

Saturday, August 15, 2009

lost wireless connection after updating ubuntu kernel



I reversed the update by reinstalling the odd kernel
linux-ubuntu-modules-2.6.24-24-generic_2.6.24-24.39_i386.deb

Thursday, August 13, 2009

add .jar library




right click on project
choose buildpath
then add libraries

Thursday, August 6, 2009

afs H drive to pc, auckland uni


need CellDBServ
and server preference

Tuesday, August 4, 2009

cout

I need to use cout in C++.
eg
cout << "Hello world"; even tho is included, program still gets compiling error "undefined variable cout"
solution:
need to use namepace std the reason in the last two lines of picture.

ref: http://www.cplusplus.com/doc/tutorial/namespaces/

I

Wednesday, July 29, 2009

Cannot open include file No such file or directory

error message: Cannot open include file 'xyz.h' No such file or directory
happens when a header file is to be included: eg #include
causes: xyz.h is not in visual studio's include folder.
sol: put xyz.h into include folder at:
"VS90COMNTOOLS=C:\Program Files\Microsoft Visual Studio 9.0\Common7\Tools\"

one way to locate the "include" folder is to open visual studio 2008 cmd prompt. see pic

for vs c++ 2008 express





for vs2005

header files in Visual studio

Monday, July 27, 2009

map network drive







same as map network drive in resource
comstu\users$\qzha085

Thursday, July 23, 2009

firefox not started ssl_error_ssl_disabled in mac

error description:
when starting firefox following error pops up:
ssl_error_ssl_disabled in mac

then can not log onto gmail, youtube...


cause:
firefox user profile corrupted

fix: delete user profile folder.
Follow instruction from here to locate profile folder in Firefox:


map network drive windows and mac

under windows:
comstu\users$\qzha085

mac:
smb://comstu/users$/qzha085

Tuesday, July 21, 2009

mssql

comman mistakes:
use ` ` around column names
use ' ' around values.
eg.
mySQL="SELECT * FROM USER where `NAME` ='michael'"
eg.

dim str,rsUser
str = CStr("michael")
mySQL="SELECT * FROM USER where `NAME`=' " &str & " ' "

otherwise you get unknow column name michael in where clause

Thursday, July 16, 2009

error:mbstring PHP extension phpmyadmin was not found

Error:
mbstring PHP extension phpmyadmin was not found

Fix:
Add extension=php_mbstring.dll under [mbstring] in php.ini
Restart Apache or IIS

Tuesday, July 7, 2009

How to compile C/C++ source code in windows

need:
when you want to compile source code

overview:
find a source code or write your own(here), then compile and run the output

step:
1 open visual studio command window


2 write simple source code in nodepad
3 compile: cl command
4 run the exe file and test






ref:
http://msdn.microsoft.com/en-us/library/ms235639(VS.80).aspx

#include

int main()
{
std::cout << "This is a native C++ program." << std::endl;
return 0;
}

Saturday, July 4, 2009

Timestamp Filename

Need:
When you want to make a filename to be current time on the system.
Idea:
get time from environment variables DATE and TIME

Example:


Ref:
http://www.dostips.com/DtTipsStringManipulation.php
http://talk.bmc.com/blogs/blog-gentle/anne-gentle/dos-timestamp-tips

Friday, July 3, 2009

Access FTP without "client"

Need:
FTP access file use internet browser, windows explorer

Overview:
enter username and password in (resource explorer or IE or Firefox) address bar

How:
ftp://username:password@ftp.servername.com

Example:

Tuesday, June 23, 2009

pdf ->image->pdf->searchable pdf

Need:
Sometimes you might want to get a section of pdf and insert it into other documents, and make this section searchable

Idea:
Extract a section of PDF as image, insert image into PDF or PowerPoint, make the image searchable


How:
pdf
select the section using "Snapshot tool"

gimp:
create image in gimp
change the ppi(pixel per inch) to >= 144.
paste the file
save as 144dpi.jpeg

pdf
convert the file to pdf
run OCR

the section becomes searchable again

Example:
Available upon request

Monday, June 8, 2009

Insert image into PDF

Prerequisite: Need to be using PDF Professional

overview:
step 1 copy image to clipboard (open image in mspaint->ctrl c)
step 2 Tools->Commenting->Paste Clipboard image









Saturday, June 6, 2009

Administrative tools

mmc compmgmt.msc



Friday, June 5, 2009

Monday, June 1, 2009

cmd_tree


tree command displays all windows folders in the first 5 levels.

Saturday, May 30, 2009

schtasks



find

find: use find to filter command line results

windows,mysql,start,


Friday, May 29, 2009

Wednesday, May 20, 2009

Run Php in command window

Run Php in command window:
To schedule a php script, one use php command.
Simply: php -f "filename.php"

Monday, May 18, 2009

glut.h

Problem:
fatal error C1083: Cannot open include file: 'gl/glut.h': No such file or directory



Fix: put glut.h in to include folder in VC++


Extra:
http://glew.sourceforge.net/install.html
http://graphics.ucsd.edu/twiki/bin/view.pl/Classes/SoftwareCSE167F08

Thursday, May 14, 2009

Connect to University Of Auckland Terminal Server

Overview:
start->run->type "mstsc" -> type upi,password, choose ec ->logged in


start-> run





mstsc


type in upi , password, choose ec


Click ok to log in...

Wednesday, May 13, 2009

Backbone(vertical) cabling vs Horizontal Cabling

This is from Cisco:

Similarity: both connects from telecommunication room.

Difference:
Backbone = vertical: connect to equipment room(where servers are).
Horizontal: connects to work area( where individual pcs and desktops are).

Telecommunications Room:
The telecommunications room is where connections to intermediary devices take place. These rooms contain the intermediary devices - hubs, switches, routers, and data service units (DSUs) - that tie the network together. These devices provide the transitions between the backbone cabling and the horizontal cabling.

Understanding University of Auckland Terminal Server

Ways to connect to server:
in Remote Desktop Connection:
comterm.com.auckland.ac.nz
then it would assign you either to commts1(IP 130.216.64.11) or commts2(130.216.64.11)
130.216.191.10 is running windows server 2000


Saturday, May 9, 2009

Administrator disabled display control panel

Problem:
Screen resolution was changed by itself.
Administrator account was not able to open "screen settings" (right click->property)
Error message: "Administrator disabled display control panel"






Fix:
open group policy object editor:
start->run->gpedit.msc
then
user settings->control pannel-> displayplay-> double click "delete display control panel"->click disable.