'ITWeb/개발일반'에 해당되는 글 490건

  1. 2011.09.07 http get length
  2. 2011.09.07 perl passwd 자동 입력
  3. 2011.09.07 eclipse maven proxy 설정
  4. 2011.09.07 [Eclipse] SVN 사용하기.
  5. 2011.04.19 3G LTE 이동통신 시스템 단말 플랫폼 기술 동향과 전망
  6. 2011.04.08 Ad Network, Ad Mediator, Ad Exchanger
  7. 2011.04.08 CPA, CPC,CPM, CPS
  8. 2010.10.22 [패턴] Observer 패턴
  9. 2010.10.22 [펌] Spring 3.0 강좌
  10. 2010.10.20 iBatis - Binary Conditional Elements

http get length

ITWeb/개발일반 2011. 9. 7. 14:49

ref. http://www.boutell.com/newfaq/misc/urllength.html

 

2006-10-13: Although the specification of the HTTP protocol does not specify any maximum length, practical limits are imposed by web browser and server software.

Microsoft Internet Explorer (Browser)

Microsoft states that the maximum length of a URL in Internet Explorer is 2,083 characters, with no more than 2,048 characters in the path portion of the URL. In my tests, attempts to use URLs longer than this produced a clear error message in Internet Explorer.

Firefox (Browser)

After 65,536 characters, the location bar no longer displays the URL in Windows Firefox 1.5.x. However, longer URLs will work. I stopped testing after 100,000 characters.

Safari (Browser)

At least 80,000 characters will work. I stopped testing after 80,000 characters.

Opera (Browser)

At least 190,000 characters will work. I stopped testing after 190,000 characters. Opera 9 for Windows continued to display a fully editable, copyable and pasteable URL in the location bar even at 190,000 characters.

Apache (Server)

My early attempts to measure the maximum URL length in web browsers bumped into a server URL length limit of approximately 4,000 characters, after which Apache produces a "413 Entity Too Large" error. I used the current up to date Apache build found in Red Hat Enterprise Linux 4. The official Apache documentation only mentions an 8,192-byte limit on an individual field in a request.

Microsoft Internet Information Server

The default limit is 16,384 characters (yes, Microsoft's web server accepts longer URLs than Microsoft's web browser). This is configurable.

Perl HTTP::Daemon (Server)

Up to 8,000 bytes will work. Those constructing web application servers with Perl's HTTP::Daemon module will encounter a 16,384 byte limit on the combined size of all HTTP request headers. This does not include POST-method form data, file uploads, etc., but it does include the URL. In practice this resulted in a 413 error when a URL was significantly longer than 8,000 characters. This limitation can be easily removed. Look for all occurrences of 16x1024 in Daemon.pm and replace them with a larger value. Of course, this does increase your exposure to denial of service attacks.

Recommendations

Extremely long URLs are usually a mistake. URLs over 2,000 characters will not work in the most popular web browser. Don't use them if you intend your site to work for the majority of Internet users.

When you wish to submit a form containing many fields, which would otherwise produce a very long URL, the standard solution is to use the POST method rather than the GET method:

...

The form fields are then transmitted as part of the HTTP transaction body, not as part of the URL, and are not subject to the URL length limit. Short-lived information should not be stored in URLs.

As a rule of thumb, if a piece of information isn't needed to regenerate the same page as a result of returning to a favorite or bookmark, then it doesn't belong in the URL.

The Bookmark Problem

In very rare cases, it may be useful to keep a large amount of "state" information in a URL. For instance, users of a map-navigating website might wish to add the currently displayed map to their "bookmarks" or "favorites" list and return later. If you must do this and your URLs are approaching 2,000 characters in length, keep your representation of the information as compact as you can, squeezing out as much "air" as possible. If your field names take up too much space, use a fixed field order instead. Squeeze out any field that doesn't really need to be bookmarked. And avoid large decimal numbers - use only as much accuracy as you must, and consider a base-64 representation using letters and digits (I didn't say this was easy).

In extreme cases, consider using the gzip algorithm to compress your pretty but excessively long URL. Then reencode that binary data in base64 using only characters that are legal in URLs. This can yield a 3-4x space gain, at the cost of some CPU time when you unzip the URL again on the next visit. Again, I never said it was easy!

An alternative is to store the state information in a file or a database. Then you can store only the identifier needed to look up that information again in the URL. The disadvantage here is that you will have many state files or database records. Some of which might be linked to on websites run by others. One solution to this problem is to delete the state files or database records for the URLs that have not been revisited after a certain amount of time.

"What happens if the URL is too long for the server?"

What exactly happens if a browser that supports very long URLs (such as Firefox) submits a long URL to a web server that does not support very long URLs (such as a standard build of Apache)?

The answer: nothing dramatic. Apache responds with a "413 Entity Too Large" error, and the request fails.

This response is preferable to cutting the URL short, because the results of cutting the URL short are unpredictable. What would that mean to the web application? It varies. So it's better for the request to fail.

In the bad old days, some web servers and web browsers failed to truncate or ignore long URLs, resulting in dangerous "buffer overflow" situations. These could be used to insert executable code where it didn't belong... resulting in a security hole that could be exploited to do bad things.

These days, the major browsers and servers are secure against such obvious attacks - although more subtle security flaws are often discovered (and, usually, promptly fixed).

While it's true that modern servers are themselves well-secured against long URLs, there are still badly written CGI programs out there. Those who write CGI programs in C and other low-level languages must take responsibility for paying close attention to potential buffer overflows. TheCGIC library can help with this.

In any case, if you're a web developer and you're still asking this question, then you probably haven't paid attention to my advice about how to avoid the problem completely.

:

perl passwd 자동 입력

ITWeb/개발일반 2011. 9. 7. 14:16
  1. print "Enter Your Password: "; $oldpass = ;
  2. print "Enter Your New Password: "; $newpass = ;
  3.  
  4. open (PASSWD, "| passwd --stdin");
  5. print PASSWD "$oldpass";
  6. print PASSWD "$newpass";
  7. print PASSWD "$newpass";
  8. close(PASSWD);
:

eclipse maven proxy 설정

ITWeb/개발일반 2011. 9. 7. 14:05

처음에 eclipse proxy 설정으로 접근을 했었는데.. 잘못된 방법이였습니다.

maven settings 에 proxy 설정 하는 방법이 있습니다.

maven 설치 위치로 가셔서 conf 아래 settings.xml 을 수정 하시면 됩니다.

http://maven.apache.org/settings.html

 

이 방법으로 해결 가능 합니다. :)

 

# 참고 URL

http://maven.apache.org/guides/mini/guide-proxies.html

   
   

:

[Eclipse] SVN 사용하기.

ITWeb/개발일반 2011. 9. 7. 13:46

1. eclipse 를 실행 합니다.

2. Help 메뉴에서 Install Software 를 선택 합니다.

3. Add 버튼을 누릅니다.

4. url 에 아래 정보를 입력 합니다.

    http://subclipse.tigris.org/update_1.6.x

5. subclipse 를 선택해서 설치를 합니다.

6. repository 등록 합니다.

:

3G LTE 이동통신 시스템 단말 플랫폼 기술 동향과 전망

ITWeb/개발일반 2011. 4. 19. 22:54

최근 LTE 관련 기사가 많이 나오고 있어서 구글링한 PDF 파일 첨부 합니다.
(왜냐구요.. ㅋ 스크랩을 위해서.. ㅎㅎ)

:

Ad Network, Ad Mediator, Ad Exchanger

ITWeb/개발일반 2011. 4. 8. 10:28

※ 구글링 하면 나오는 정보

Ad Networks:

The ad network business model is very simple: They get money from advertisers, take a cut and then give the rest to their developers who are serving the ads. That’s how you (the developer) make money. Examples of ad networks include AdMob, Millennial Media, the now defunct Quattro Wireless and Jumptap.

Pros:

  • You make money.
  • You deal with one network to get your payments.
  • You only have to implement one SDK.

Cons:

  • Your income is directly dependent on the effectiveness of the ad network’s sales team. If the ad network doesn’t have ads to give you, then you can’t monetize your app.
  • It’s not uncommon to see sub 60% fill rates when using an ad network. That means that you’re losing out on 40% of the traffic that otherwise COULD be generating you money.

To solve this, developers began using multiple ad networks in an attempt to get a higher fill-rate in their apps. This was a great idea but it quickly became difficult to manage. Enter the ad mediator…

Ad Mediators:

To solve the issue of losing money on their application’s traffic, developers began using multiple networks. The basic idea was that you would install two (or more) SDKs into your app using the mediator’s code and then randomly call an ad network based on a percentage. These were called “network priorities”. Depending on how many ad networks you were working with, you could assign a different percentage to each network and your fill rate would be higher since you had more sources for ads. From there, more innovation quickly came. Instead of hard coding the ad call ratios into the app, a call to a web server was made to determine what percentages to divide among each network.  Remotely configured priorities allowed developers to control who would receive the most ad impressions, so when Network A was running a better campaign than Networks B and C, Network A would get more of the impressions. This quickly evolved into an even more elaborate system that allowed developers to set “roll-overs” in addition to the priorities so that when Network A was called and it didn’t have any ads, then Network B would be called. Examples of ad mediators are AdWhirl and Burstly. These companies provide you with a Mega-SDK solution that you can download and install into your app and then remotely control the priorities and roll-overs from your server.

Pros:

  • You make money.
  • You’ll receive a higher fill rate by working with more than one ad network.
  • You can control your “network” priorities to help optimize ads.

Cons

  • You have to manage each of the ad network relationships separately. If you wanted to use AdMob, Millennial Media and Jumptap in your app, you would need to sign up for accounts with each of them and get separate payments from each.
  • You would need to login to all networks to get your ad reporting information (AKA: find out how much money you’re making). Ad mediators don’t know how much money you’re actually making from each network, so they can’t optimize your priorities and roll-overs to give you the best payouts for your ad impressions. That’s on you to do.
  • Optimizations are based on general averages for each network rather than what you’re actually making. Since many ad networks will run special campaigns depending on the app (AKA: targeting), these averages tend to be very “off” and potentially will make you lose money.
  • Since they are integrating 5+ SDKs, stability is an unknown and there is a massive inconvenience of having to update your app every time you want to ad a new network.

Mediators are a very popular choice for app developers, but there are other options to explore. Enter the ad exchange…

Ad Exchanges:

The ad exchange alternative gives you the best of both worlds by combining the things developers love about working with ad networks and ad mediators and then adding the technology to make it all work smoothly.

The ad exchange sits in the middle of developers and networks and links the two with an intelligent ad-serving platform. Developers download the exchange’s SDK and make calls for ads and the exchange uses a vast amount of information to find the ad within their system that will give the developer the most amount of money for that ad request.

Pros:

  • You make money.
  • You only have to manage one relationship with the exchange and get support, payments, controls and reporting all from the same place.
  • When the exchange adds a network to their platform, all of their developers automatically get access to it without the need to make any changes to their app. Since the SDK rarely changes, a very reliable and stable product is produced (which means less crashes for your app).
  • Access to reporting data and campaign information that ad mediators don’t have; this allows exchanges to “Auto Optimize” the priorities and roll-overs for each application using the best information available which means that you will get paid the absolute highest amount possible.
  • For many people (depending on the platform and ad size), ad exchanges can potentially produce 100% fill rates.

Cons:

  • Transparency on what ads are served in your app is hard to achieve. But Mobclix fixes this problem by giving developers control over what type of content would be suitable in their apps.
  • Different networks pay out at different times, which means that developers may deal with multiple payment terms and receive payments at various times (NET 90, NET 60…etc). Mobclix solves this by providing all of the invoice items to the developer and making it clear when each network pays.
:

CPA, CPC,CPM, CPS

ITWeb/개발일반 2011. 4. 8. 10:26
※ 구글링 하면 나오는 정보 입니다.

There are three main ways of generating revenue with ads. They are CPA, CPC, and CPM. Below is a brief explanation of each.

CPA
means cost per action/acquisition. You get paid whenever a visitor you your page does something such as make a purchase.
CPC
means cost per click. This means that the cost of the ad is decided by the amount of clicks. You get paid whenever an ad is clicked.
CPM
means cost per millennium. This means that the cost is decided by the impression. You get paid whenever the ad gets shown.

CPS means cost per sale. Pricing based on the number of sales transactions your ad generates. Since users may visit your site several times before making a purchase.

:

[패턴] Observer 패턴

ITWeb/개발일반 2010. 10. 22. 10:41
구글링 하면.. 참 많은 자료들이 나온다.

Observer 패턴
class 또는 object 의 어떤 상태의 변화를 자동으로 알려주도록 설계 하는 방법
분산 시스템이나 이벤트 시스템에 사용

wikipedia : http://en.wikipedia.org/wiki/Observer_pattern
:

[펌] Spring 3.0 강좌

ITWeb/개발일반 2010. 10. 22. 10:14
동영상 강좌 링크 : https://www.ibm.com/developerworks/mydeveloperworks/blogs/9e635b49-09e9-4c23-8999-a4d461aeace2/entry/264?lang=ko)

스프링3.0 강좌입니다.
내용은 아주 기초적인 내용이며 쉽게 설명이 되어 있내요.

Dependency Injection : 객체간 의존성을 제거하기 위해 사용
@IoC : singletone pattern 지원

늘 느끼는 거지만.. 용어와 정의에 대해서 잘 모르면 아는것도 모르게 되는 것 같내요..
참.. 배움이라는건.. 언제나 그렇듯이.. 즐거워요 ㅋㅋ
:

iBatis - Binary Conditional Elements

ITWeb/개발일반 2010. 10. 20. 13:48
원본링크 : http://ibatis.apache.org/docs/dotnet/datamapper/ch03s09.html

3.9.1. Binary Conditional Elements

Binary conditional elements compare a property value to a static value or another property value. If the result is true, the body content is included in the SQL query.

3.9.1.1. Binary Conditional Attributes:

prepend – the overridable SQL part that will be prepended to the statement (optional)
property – the property to be compared (required)
compareProperty – the other property to be compared (required or compareValue)
compareValue – the value to be compared (required or compareProperty)

Table 3.7. Binary conditional attributes

Element Description
<isEqual> Checks the equality of a property and a value, or another property. Example Usage:
<isEqual prepend="AND" 
             property="status" 
             compareValue="Y">
MARRIED = ‘TRUE'
</isEqual>               
<isNotEqual> Checks the inequality of a property and a value, or another property. Example Usage:
<isNotEqual prepend="AND" 
             property="status" 
             compareValue="N">
MARRIED = ‘FALSE'
</isNotEqual>   
<isGreaterThan> Checks if a property is greater than a value or another property. Example Usage:
<isGreaterThan prepend="AND" 
             property="age" 
             compareValue="18">
ADOLESCENT = ‘FALSE'
</isGreaterThan>   
<isGreaterEqual> Checks if a property is greater than or equal to a value or another property. Example Usage:
<isGreaterEqual prepend="AND" 
             property="shoeSize" 
             compareValue="12">
BIGFOOT = ‘TRUE'
</isGreaterEqual>
<isLessEqual> Checks if a property is less than or equal to a value or another property. Example Usage:
<isLessEqual prepend="AND" 
             property="age" 
             compareValue="18">
ADOLESCENT = ‘TRUE'
</isLessEqual>

3.9.2. Unary Conditional Elements

Unary conditional elements check the state of a property for a specific condition.

3.9.2.1. Unary Conditional Attributes:

prepend – the overridable SQL part that will be prepended to the statement (optional)
property – the property to be checked (required)

Table 3.8. Unary conditional attributes

Element Description
<isPropertyAvailable> Checks if a property is available (i.e is a property of the parameter object). Example Usage:
<isPropertyAvailable property="id" >
  ACCOUNT_ID=#id# 
</isPropertyAvailable>
<isNotPropertyAvailable> Checks if a property is unavailable (i.e not a property of the parameter object). Example Usage:
<isNotPropertyAvailable property="age" >
  STATUS='New' 
</isNotEmpty>
<isNull> Checks if a property is null. Example Usage:
<isNull prepend="AND" property="order.id" >
  ACCOUNT.ACCOUNT_ID = ORDER.ACCOUNT_ID(+) 
</isNotEmpty>
<isNotNull> Checks if a property is not null. Example Usage:
<isNotNull prepend="AND" property="order.id" >
  ORDER.ORDER_ID = #order.id#
</isNotEmpty>
<isEmpty> Checks to see if the value of a Collection, String property is null or empty ("" or size() < 1). Example Usage:
<isEmpty property="firstName" >
  LIMIT 0, 20
</isNotEmpty>
<isNotEmpty> Checks to see if the value of a Collection, String property is not null and not empty ("" or size() < 1). Example Usage:
<isNotEmpty prepend="AND" property="firstName" >
  FIRST_NAME LIKE '%$FirstName$%'
</isNotEmpty>

3.9.3. Parameter Present Elements

These elements check for parameter object existence.

3.9.3.1. Parameter Present Attributes:

prepend – the overridable SQL part that will be prepended to the statement (optional)

Table 3.9. Testing to see if a parameter is present

Element Description
<isParameterPresent> Checks to see if the parameter object is present (not null).
<isParameterPresent prepend="AND">
  EMPLOYEE_TYPE = #empType#
</isParameterPresent>
<isNotParameterPresent> Checks to see if the parameter object is not present (null). Example Usage:
<isNotParameterPresent prepend="AND">
  EMPLOYEE_TYPE = ‘DEFAULT'
</isNotParameterPresent>


3.9.4. Iterate Element

This tag will iterate over a collection and repeat the body content for each item in a List

3.9.4.1. Iterate Attributes:

prepend – the overridable SQL part that will be prepended to the statement (optional)
property – a property of type IList that is to be iterated over (required)
open – the string with which to open the entire block of iterations, useful for brackets (optional)
close – the string with which to close the entire block of iterations, useful for brackets (optional)
conjunction – the string to be applied in between each iteration, useful for AND and OR (optional)

Table 3.10. Creating a list of conditional clauses

Element Description
<iterate> Iterates over a property that is of type IList Example Usage:
<iterate prepend="AND" property="UserNameList"
  open="(" close=")" conjunction="OR">
  username=#UserNameList[]#
</iterate>
Note: It is very important to include the square brackets[] at the end of the List property name when using the Iterate element. These brackets distinguish this object as an List to keep the parser from simply outputting the List as a string.


: