[LINUX] burn a DVD ISO
TIPs 2014. 8. 5. 16:26# wodim --devices
# wodim -v dev=/dev/sg1 speed=4 -eject /path/to/file.iso
'분류 전체보기'에 해당되는 글 126건
[LINUX] burn a DVD ISOTIPs 2014. 8. 5. 16:26# wodim --devices # wodim -v dev=/dev/sg1 speed=4 -eject /path/to/file.iso SSH login without passwordCS/Linux 2014. 3. 26. 15:01원문 : http://www.linuxproblem.org/art_9.html a@A 에서 b@B 로 password 없이 로그인 a@A:~> ssh-keygen -t rsa Linux NAT server forwarding [ubuntu]CS/Network 2013. 12. 9. 20:52원문 : http://www.linuxrookie.com/?p=160 http://www.howtoforge.com/nat_iptables private interface : eth1 public interface : eth0 1. Open the forward option # echo 1 > /proc/sys/net/ipv4/ip_forward or # vim /etc/sysctl.conf change net.ipv4.ip_forward = 0,let 0 to 1 2. Config NAT rules # iptables –t nat –A POSTROUTING –s 192.168.100.0/24 –o eth0 –j MASQUERADE # iptables –A FORWARD –i eth1 –j ACCEPT 3. Permanently update iptables # apt-get install iptables-persistent # iptables-save > /etc/iptables/rules.v4 [SHELL] 특수 변수CS/Shell/Perl/Python 2013. 8. 13. 10:27원문 : http://unixhelp.ed.ac.uk/scrpt/scrpt2.2.2.html
[Linux] Emacs tomorrow themeTIPs 2013. 3. 4. 18:03링크: https://github.com/chriskempson/tomorrow-theme/tree/master/GNU%20Emacs (setq load-path (cons (expand-file-name "~/.emacs.d") load-path)) (load-library "color-theme-tomorrow") (color-theme-tomorrow-night) 현재 터미널이 256 칼라가 아니라면 $ tput colors 8 256 color 설정 export TERM="xterm-256color" 이미지 파일 생성 / 마운트CS/Linux 2012. 11. 1. 22:06# dd if=/dev/zero of=disk.img bs=4k count=1024 # mkfs.ext3 -F disk.img # mount -o loop disk.img mount_point or # losetup /dev/loop0 disk.img # mount /dev/loop mount_point Apache + mod_wsgi + Django install from sourceDevelop/Web 2012. 2. 10. 20:43OpenSSL (필요한 경우만) http://www.openssl.org/ http://httpd.apache.org/docs/2.0/mod/mod_ssl.html # ./config --prefix=/path/to/openssl Apache http://httpd.apache.org/ [mpm-worker] extra/httpd-wcgi.conf 생성 http://blog.stannard.net.au/2010/12/11/installing-django-with-apache-and-mod_wsgi-on-ubuntu-10-04/ http://gauryan.blogspot.com/2010/10/apache-django-modwsgi.html http://bryanhelmig.com/setting-up-ubuntu-10-04-with-apache-memcached-ufw-mysql-and-django-1-2-on-linode/ https://code.djangoproject.com/wiki/django_apache_and_mod_wsgi http://code.google.com/p/modwsgi/wiki/IntegrationWithDjango LoadModule wsgi_module modules/mod_wsgi.so
NameVirtualHost *:80 <VirtualHost *:80> ServerName localhost DocumentRoot /app/foo
<Location /> Allow from all </Directory>
WSGIScriptAlias / /app/foo/django.wsgi </VirtualHost> httpd.conf 파일 수정
포트 막혀있는 경우 80번 열어주기 /etc/sysconfig/iptables 에 다음 추가 Python http://python.org/getit/ # ./configure --prefix=/path/to/python \ mod_wsgi http://code.google.com/p/modwsgi/wiki/QuickInstallationGuide http://code.google.com/p/modwsgi/wiki/PerformanceEstimates # ./configure --with-apxs=/path/to/httpd/bin/apxs \ Django https://www.djangoproject.com/download/ # python setup.py install Sample Project # cd /app/ import sys sys.path.append('/app/') os.environ['DJANGO_SETTINGS_MODULE'] = 'foo.settings'
import django.core.handlers.wsgi application = django.core.handlers.wsgi.WSGIHandler() [IPHONE] UUID 생성CS/iPhone 2012. 1. 24. 17:52원문 : http://stackoverflow.com/questions/7016311/how-to-generate-unique-identifier
+ (NSString *)uuid { CFUUIDRef uuidRef = CFUUIDCreate(NULL); CFStringRef uuidStringRef = CFUUIDCreateString(NULL, uuidRef); CFRelease(uuidRef); return [(NSString *)uuidStringRef autorelease]; } [IPHONE] TableViewCell styleCS/iPhone 2012. 1. 14. 22:41원문 : http://borkware.com/quickies/one?topic=UITableView
[IPHONE] Using Core DataCS/iPhone 2012. 1. 12. 23:20원문 : http://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/CoreData/cdProgrammingGuide.html
Managed Object
Custom implementation
- NSManagedObject의 서브클래스에 대해 작성하는 accessor methods의 구현에는 일반적으로 다른 클래스를 작성하는것과는 다르다.
Creating
NSManagedObject *newEmployee = [NSEntityDescription insertNewObjectForEntityForName:@"Employee" inManagedObjectContext:context]; NSManagedObject *newEmployee = [[NSManagedObject alloc] initWithEntity:employeeEntity insertIntoManagedObjectContext:context];
Entity Description
NSManagedObjectContext *context = <#Get a context#>; NSManagedObjectModel *managedObjectModel = [[context persistentStoreCoordinator] managedObjectModel]; NSEntityDescription *employeeEntity = [[managedObjectModel entitiesByName] objectForKey:@"Employee"];
NSManagedObjectContext *context = <#Get a context#>; NSEntityDescription *employeeEntity = [NSEntityDescription entityForName:@"Employee" inManagedObjectContext:context];
Deleting
NSManagedObjectContext *context = <#Get a context#>; [context deleteObject:managedObject]; - managed object context에 deleteObject: 메세지를 보내면, context는 NSManagedObjectContextObjectsDidChangeNotification 통지를 post한다. - 만약 object가 동일한 transaction에서 create되고 delete 된다면, managed object context의 deletedObject 의 결과 array나 NSManagedObjectContextDidSaveNotification 통지의 deleted object set에 나타나지 않을 것이다.
To-many relationships
NSMutableSet *employees = [aDepartment mutableSetValueForKey:@"employees"]; [employees addObject:newEmployee]; [employees removeObject:firedEmployee];
// or
[aDepartment addEmployeesObject:newEmployee]; [aDepartment removeEmployeesObject:firedEmployee]; - mutableSetValueForKey: 에 의해 리턴되는 값과 dot accessor method에 의해 리턴되는 값의 차이를 이해하는 것은 중요하다. - mutableSetValueForKey:는 mutable proxy object를 리턴한다. - 만약 그것의 내용을 바꾼다면, relationship에 대한 적절한 KVO change 통지를 emit 할 것이다. - dot accessor 는 단순히 set을 리턴한다. - 만약 [aDepartment.employees addObject:newEmployee] 와 같이 한다면, KVO change notification은 emit 되지 않을 것이며, inverse relationship은 적절하게 update되지 않을 것이다. - dot 은 accessor method를 invoke 하기 떄문에, [[aDepartment employees] addObject:newEmployee]; 도 같은 결과이다.
Manipulating Relationships and Object Graph Integrity
- Core Data 는 object graph의 consistency를 관리하기 때문에, 관계의 한쪽 끝만을 변경하면 다른 면은 Core Data 가 관리해 준다. anEmployee.department = newDepartment; or [newDepartment addEmployeeObject:anEmployee];
Managed Object Context
Undo management
- 각 managed object context는 undo manager를 유지한다. - Undo 비활성화 [context processPendingChanges]; // Flush operations for which you want undos [[context undoManager] disableUndoRegistration];
// Make changes for which undo operations are not to be recorded // ...
[context processPendingChanges]; // Flush operations for which you do not want undos [[context undoManager] enableUndoRegistration];
Managed Object Model
Runtime에 NSManagedObjectModel 얻기
[[<#A managed object context#> persistentStoreCoordinator] managedObjectModel];
[[<#A managed object#> entity] managedObjectModel];
Fetch
Fetching managed objects
NSManagedObjectContext *context = [self managedObjectContext]; NSEntityDescription *entityDescription = [NSEntityDescription entityForName:@"Employee" inManagedObjectContext:context]; NSFetchRequest *request = [[NSFetchRequest alloc] init]; [request setEntity:entityDescription];
NSNumber *minimumSalary = ...; NSPredicate *predicate = [NSPredicate predicateWithFormat: @"(lastName LIKE[c] 'Worsley') AND (salary > %@)", minimumSalary]; [request setPredicate:predicate];
NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"firstName" ascending:YES]; [request setSortDescriptors:[NSArray arrayWithObject:sortDescriptor]]; [sortDescriptor release];
NSError *error = nil; NSArray *array = [context executeFetchRequest:request error:&error];
Template 사용
NSManagedObjectModel *model = <#Get a model#>; NSFetchRequest *requestTemplate = [[NSFetchRequest alloc] init]; NSEntityDescription *publicationEntity = [[model entitiesByName] objectForKey:@"Publication"]; [requestTemplate setEntity:publicationEntity]; NSPredicate *predicateTemplate = [NSPredicate predicateWithFormat: @"(mainAuthor.firstName like[cd] $FIRST_NAME) AND \ (mainAuthor.lastname like[cd] $LST_NAME) AND \ (publicationDate > $DATE)"]; [requestTemplate setPredicate:predicateTemplate]; [model setFetchRequestTemplate:requestTemplate forName:@"PublicationsForAuthorSinceDate"]; [requestTemplate release]; NSError *error = nil; NSDictionary *substitutionDictionary = [NSDictionary dictionaryWithObjectsAndKeys: @"Fiona", @"FIRST_NAME", @"Verde", @"LAST_NAME", [NSDate dateWithTimeIntervalSinceNow:-31356000], @"DATE", nil]; NSFetchRequest *fetchRequest = [model fetchRequestFromTemplateWithName:@"PubliccationsForAuthorSinceDate" substitutionVariables:substitutionDictionary]; NSManagedObjectContext *context = <#Get a managed object context#>; NSArray *results = [context executeFetchRequest:fetchRequest error:&error];
Retrieving specific objects
NSManagedObjectContext *context = [self managedObjectContext]; NSEntityDescription *entityDescription = [NSEntityDescription entityForName:@"Employee" inManagedObjectContext:context]; NSFetchRequest *request = [[NSFetchRequest alloc] init]; [request setEntity:entityDescription]; [request release];
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"self == %@", targetObject]; [request setPredicate:predicate];
NSError *error = nil; NSArray *array = [context executeFetchRequest:request error:&error]; [IPHONE] 나눔고딕 적용CS/iPhone 2011. 12. 29. 03:25참고 : http://kgriff.posterous.com/45359635
1. plist 에 폰트 등록 <array> <string>NanumGothicExtraBold.ttf</string> <string>NanumGothicBold.ttf</string> <string>NanumGothic.ttf</string> </array> 혹은 "Fonts provided by application" 에 추가 OTF는 시뮬러에터에서는 동작하나, Device 에서 동작 안하는듯. (확인 필요) 2. 사용 [UIFont fontWithName:@"NanumGothicExtraBold" size:22.0]; [Linux] CPU 관련 정보 보기TIPs 2011. 10. 18. 08:101. cat /proc/cpuinfo
2. lscpu 3. /sys/devices/system/cpu/cpuN 밑의 정보 보기 4. dmesg 에서 보기 [Mac] Mac USB to Serial (RS232)TIPs 2011. 10. 13. 18:27Driver Download : http://www.ftdichip.com/FTDrivers.htm
확인 : ls /dev/tty.* 연결 : screen /dev/tty.usbserial-xxxxx 115200 Ubuntu에서 고정 IP 설정CS/Linux 2011. 9. 8. 13:38/etc/network/interfaces
auto lo iface lo inet loopback
iface ethX inet static address X.X.X.X netmask 255.255.255.0 gateway X.X.X.X dns-nameservers 8.8.8.8 /etc/resolv.conf nameserver 8.8.8.8 SSH login without passwordCS/Linux 2011. 9. 8. 13:29원문 : http://linuxproblem.org/art_9.html
a@A:~> ssh-keygen -t rsa Ubuntu에서 패키지 잠그기/풀기TIPs 2011. 7. 28. 14:38원문 : http://nice295.egloos.com/1305825
1. Hold # echo -e "package hold" | dpkg --set-selections 2. Unhold # echo -e "package unhold" | dpkg --set-selections 3. 확인 #dpkg --get-selections | grep hold http proxy 사용TIPs 2011. 7. 28. 14:26원문 : http://nice295.egloos.com/1305825
1. .bashrc에 아래 추가 export http_proxy=http://<your_PROXY_SERVER>:<port> 2. /etc/apt/apt.conf에 아래 추가(다른 app를 위한 것) Acquire::http::Proxy "http://<your_PROXY_SERVER>:<port>"; [MAC] 맥에서 USB에 부팅가능한 이미지 만들기 (bootable USB stick)TIPs 2011. 7. 27. 15:35원문 : http://renevanbelzen.wordpress.com/2009/10/14/creating-a-bootable-usb-stick-with-mac-os-x-in-10-easy-steps/
USB 삽입 후 1. USB 디바이스 이름 확인.
$ diskutil list
2. 언마운트 $ diskutil unmountDisk /dev/diskN 3. 복사 $ sudo dd if=/path/to/file.dmg of=/dev/diskN bs=1m 4. 추출 diskutil eject /dev/diskN [MAKE] Functions for Transforming TextCS/Shell/Perl/Python 2011. 6. 8. 16:43원문 : GNU make
8.4 Functions for Conditionals 조건 표현을 제공하는 세 가지 함수가 있다. 모든 인자가 초기에 확장되지 않는다는 것이 이 세 함수의 중요한 면이다. 인자 중 확장되기를 원하는 인자만이 확장된다.
[MAKE] Conditional PartsCS/Shell/Perl/Python 2011. 6. 8. 15:18원문 GNU make
7.1 Example of a Conditional 다음 예제는 CC변수가 gcc인 경우에 make가 라이브러리들 중 하나의 셋을 사용하게 하고, gcc가 아닌 경우에는 다른 라이브러리 셋을 사용하게 한다. libs_for_gcc = -lgnu 혹은, 다음과 같이 변수를 조건부로 할당하고, 변수를 명시적으로 사용할 수도 있다 libs_for_gcc = -lgnu 7.2 Syntax of Conditionals syntax는 else가 없는 다음의 가장 간단한 형태부터 else를 포함한 두가지 형태가 있다. conditional-directive text-if-true endif conditional-directive text-if-true else text-if-false endif conditional-directive text-if-true else text-if-false else text-if-false endif 조건을 테스트하는데는 다음의 4가지 지시자가 있다
7.3 Conditionals that Test Flags findstring 함수와 함께 MAKEFLAGS 변수를 사용하여 -t 와 같은 make command flags를 테스트하는 조건을 쓸 수 있다. 이것은 touch가 파일을 갱신하는데 충분하지 않을 때 유용하다. findstring 함수는 한 문자열이 다른 부분 문자열로 나타나는지 확인한다. 만약 '-t' 플래그에 대해서 테스트하길 원한다면, 첫번째 문자열로 't'를 사용하고 비교할 다른 문자열로 MAKEFLAGS의 값을 사용한다. 다음은 아카이브 파일을 갱신하는 것에대해 마킹하는것을 종료하기 위해 'ranlib -t'를 사용하는것을 어떻게 정리하는지를 보여준다. archive.a: ... [MAKE] How to Use VariablesCS/Shell/Perl/Python 2011. 6. 8. 06:52원문 : GNU make
6.1 Basics of Variable References 변수 이름에는 대문자를 사용하는 것이 관행이다. 하지만, makefile 안에서 internal purpose 을 수행하는 것은 소문자를 사용하고, 암묵적인 규칙을 제어하는 파라매터나 컴맨드 옵션에서 사용자가 오버라이드 해야만 하는 파라메터에 대해서는 대문자로 예약할 것을 것을 권장 한다. $(foo) 나 ${foo} 와 같이 변수 이름을 () 나 {}로 감사고 $를 붙여서 참조할 수 있다. 6.2 The Two Flavors of Variables GNU make 에서는 변수가 값을 갖도로 하는 네 가지 방법이 있다.
6.3 Advanced Features for Reference to Variables
특권 레벨 (Privilege ring level)CS/Common 2011. 5. 25. 14:19원문 : Intel 64 and IA-32 Architectures Software Developer's Manual Volume 3A
권한 레벨은 세그먼트 디스크립터의 세그먼트 셀렉터가 세그먼트 레지스터로 로드될 때 체크된다. CPL (Current Privilege Level) : 현재 실행되고 있는 태스크의 특권 레벨로, CS, SS 세그먼트 레지스터 0, 1 번째 비트. : 일반적으로 CPL은 명령어가 페치되는 코드 세그먼트의 특권 레벨과 동일하다. : 프로세서는 프로그램 컨트롤이 다른 권한 레벨을 가진 코드 세그먼트로 전이될 때 CPL을 변경한다. : CPL은 conforming 코드 세그먼트에 접근할 때 약간 다르게 취급된다. Confirming 코드 세그먼트는 confirming 코드의 DPL보다 같거나 더 작은 권한(숫자적으로 높은)을 가진 어떤 다른 권한 레벨에서 접근될 수 있다. : CPL은 프로세서가 CPL과 다른 권한 레벨을 가진 conforming 코드 세그먼트에 접근할 때 변경되지 않는다. DPL (Descriptor Privilege Level) : 세그먼트나 게이트 디스크립터가 포함하고 있는 필드. : 세그먼트나 게이트의 특권레벨. : 현재 실행되고 있는 코드가 세그먼트나 게이트에 접근하려고 할 때, 세그먼트나 게이트의 DPL은 CPL과 세그먼트가 게이트의 RPL과 비교된다. : DPL은 세그먼트나 게이트가 엑세스되고 있는 타입에 따라 다르게 해석된다.
: 세그먼트 셀렉터의 0, 1 번째 비트. : 세그먼트 셀렉터에 할당된 override된 권한 레벨이다. : 프로세서는 세그먼트의 접근이 허용되는지 판단하기 위해 CPL과 함께 RPL을 체크한다. : 비록 세그먼트의 접근을 요청하는 프로그램이나 태스크가 세그먼트에 접근하기 위한 충분한 권한을 가지고 있더라도, 만약 RPL이 충분한 권한 레벨을 가지고 있지 않다면, 접근은 거부된다. 즉, 세그먼트 셀렉터의 RPL이 CPL보다 낮은 권한 레벨(숫자상으로 높은)인 경우, RPL은 CPL을 override 한다. (반대도 마찬가지이다.) : 5.10.4 Checking Caller Access Privileges (ARPL Instruction) 참고 : RPL은 만약 프로그램 자체가 세그먼트에 대한 엑세스 권한을 가지고 있지 않다면 에플리케이션 프로그램 대신에 권한 코드(privileged code)가 세그먼트에 접근하지 않는 것을 보장하기 위해 사용된다. 발번역 주의. 이놈의 영어... ㅜㅜ Why not mmap?CS/Linux 2011. 5. 20. 10:36
원문 : http://useless-factor.blogspot.com/2011/05/why-not-mmap.html
mmap() is a beautiful interface. Rather than accessing files through a series of read and write operations, mmap() lets you virtually load the whole file into a big array and access whatever part you want just like you would with other RAM. (It lets you do other things, too—in particular, it's the basis of memory allocation. See the man page for details.) In this article, I'll be discussing mmap() on Linux, as it works in virtual memory systems like x86.
mmap() doesn't actually load the whole file in when you call it. Instead, it loads nothing in but file metadata. In the memory page table, all of the mapped pages are given the setting to make a page fault if they are read or written. The page fault handler loads the page and puts it into main memory, modifying the page table to not fault for this page later. In this way, the file is lazily read into memory. The file is written back out through the same writeback mechanism used for the page cache in buffered I/O: after some time or under some memory pressure, the contents of memory are automatically synchronized with the disk.
mmap() is a system call, implemented by the kernel. Why? As far as I can tell, what I described above could be implemented in user-space: user-space has page fault handlers and file read/write operations. But the kernel allows several other advantages:
One situation where mmap() looks useful is databases. What could be easier for a database implementor than an array of "memory" that's transparently persisted to disk? Database authors often think they know better than the OS, so they like to have explicit control over caching policy. And various file and memory operations give you this, in conjunction with mmap():
Great! And in Linux, you can open up a raw block device just by opening a file like /dev/hda1 and use mmap() straight from there, so this gives database implementors a way to control the whole disk with the same interface. This is great if you're a typical database developer who doesn't like the OS and doesn't trust the file system.
So this sounds like a nice, clean way to write a database or something else that does serious file manipulation. Some databases use this, for example MongoDB. But the more advanced database implementations tend to open the database file in O_DIRECT mode and implement their own caching system in user-space. Whereas mmap() lets you use the hardware (on x86) page tables for the indirection between the logical address of the data and where it's stored in physical memory, these databases force you to go through an extra indirection in their own data structures. And these databases have to implement their own caches, even though the resulting caches often aren't smarter than the default OS cache. (The logic that makes the caching smarter is often encoded in an application-specific prefetcher, which can be done pretty clearly though memory mapping.)
A problem with mmap()
High-performance databases often get lots of requests. So many requests that, if they were to spawn a thread for each one of them, the overhead of a kernel task per request would slow them down (where task means 'thread or process', in Linux terminology). There's a bit of overhead for threads:
To solve these issues, database implementors often respond to each request with a user-level coroutine, or even with an explicitly managed piece of state sent around through various callbacks.
Let's say we have a coroutine responding to a database request, and this coroutine wants to read from the database in a location that is currently stored on disk. If it accesses the big array, then it will cause a memory fault leading to a disk read. This will make the current task block until the disk read can be completed. But we don't want the whole task to block—we just want to switch to another coroutine when we have to wait, and we want to execute that coroutine from the same task.
The typical way around this problem is using asynchronous or non-blocking operations. For non-blocking I/O, there's epoll, which works for some kinds of files. For direct I/O on disk, Linux provides a different interface called asynchronous I/O, with system calls like io_submit. These two mechanisms can be hooked up with an eventfd, which is triggered whenever there are AIO results, using the undocumented system call io_set_eventfd. The basic idea is that you set up a bunch of requests in an object, and then you have a main loop, driven by epoll, where you repeatedly ask for the next available event. The coroutine scheduler resumes the coroutine that had the event complete on it, and executes that coroutine until it blocks again. Details about using this mechanism are a bit obtuse, but not very deep or complicated.
A proposed solution
What the mmap() interface is missing is a non-blocking way to access memory. Maybe this would take the form of a call based around mlock, like
int mlock_eventfd(const void *addr, ssize_t len, int eventfd);
which would trigger the eventfd once the memory from addr going length len was locked in memory. The eventfd could be placed in an epoll loop and then the memory requested would be dereferenced for real once it was locked. A similar mechanism would be useful for fdatasync.
We could implement mlock_eventfd in user-space using a thread pool, and the same goes for fdatasync. But this would probaly eliminate the performance advantages of using coroutines in the first place, since accessing the disk is pretty frequent in databases.
As databases and the devices that underlie them grow more complex, it becomes difficult to manage this complexity. The operating system provides a useful layer of indirection between the database and the drive, but old and messy interfaces make the use of the OS more difficult. Clean, high-level OS interfaces which let applications take full advantage of the hardware and kernel-internal mechanisms and statistics would be a great boon to further database development, allowing the explosion of new databases and solid-state drives to be fully exploited. [BASH, PERL] Multiline stringCS/Shell/Perl/Python 2011. 4. 24. 15:50참고:
http://serverfault.com/questions/72476/clean-way-to-write-complex-multi-line-string-to-a-variable BASH cat <<EOF This is Multiline String. EOF This is Multiline String. EOF PERL my $VALUE =<<ENDVALUE; This is Multiline String. ENDVALUE my $VALUE = "This is Multiline String. "; [PERL] 최소 일치 정규 표현식 (Non-greedy regular expression)CS/Shell/Perl/Python 2011. 4. 15. 13:14원문: http://www.bayview.com/blog/2003/02/12/non-greedy-regular-expressions/
$src = "www.google.com" $www = ($src =~ /(.*)\./ && 1); 과 같이 할 경우 기본적으로 greedy matching이 되기 때문에 $www = "www.google" 이 된다. 방법 1. 방법 2. [JAVASCRIPT] location.href 와 location.replace()CS/JavaScript/HTML/CSS 2011. 3. 14. 17:17원문:
location.href
1. 프로퍼티
2. 현재 Page의 전체 URL
3. set 할 경우 URL이 바뀌게 되므로, history에 push.
location.replace()
1. 메소드
2. 현재 Document를 바꿈(replace).
3. URL을 바꾸는 것이 아니라, 같은 URL에 대해서 Document만 바뀌는 것이므로, history에 push되지는 않음.
|