锘??xml version="1.0" encoding="utf-8" standalone="yes"?>湖南幸运赛车直播官网:BlogJava - ▼幸运赛车规则▼幸运赛车投注▼幸运赛车开奖结果查询▼湖南幸运赛车开奖奖金▼幸运赛车走势▼//www.cqk4s.cn/gembin/<font color="red">OSGi, Eclipse Equinox, ECF, Virgo, Gemini, Apache Felix, Karaf, Aires, Camel, Eclipse RCP</font><br/><br/> <font color="green">HBase, Hadoop, ZooKeeper, Cassandra</font><br/><br/> <font color="blue">Flex4, AS3, Swiz framework, GraniteDS, BlazeDS etc.</font><br/><br/> <font color="black"> There is nothing that software can't fix. Unfortunately, there is also nothing that software can't completely fuck up. That gap is called talent.</font> <br/><br/> <a >About Me</a> <script type="text/javascript" src="//platform.linkedin.com/in.js"></script><script type="in/share" data-counter="right"></script> zh-cnSun, 24 Mar 2019 19:10:27 GMTSun, 24 Mar 2019 19:10:27 GMT60Overriding Vs Hiding - ▼幸运赛车规则▼幸运赛车投注▼幸运赛车开奖结果查询▼湖南幸运赛车开奖奖金▼幸运赛车走势▼//www.cqk4s.cn/gembin/archive/2014/05/29/414246.htmlgembingembinThu, 29 May 2014 07:52:00 GMT//www.cqk4s.cn/gembin/archive/2014/05/29/414246.html//www.cqk4s.cn/gembin/comments/414246.html//www.cqk4s.cn/gembin/archive/2014/05/29/414246.html#Feedback0//www.cqk4s.cn/gembin/comments/commentRss/414246.html//www.cqk4s.cn/gembin/services/trackbacks/414246.htmlCan I override a static method?

Many people have heard that you can't override a static method. This is true - you can't. However it is possible to write code like this:


class Foo {
    public static void method() {
        System.out.println("in Foo");
    }
}

class Bar extends Foo {
    public static void method() {
        System.out.println("in Bar");
    }
}

This compiles and runs just fine. Isn't it an example of a static method overriding another static method? The answer is no - it's an example of a static method hiding another static method. If you try to override a static method, the compiler doesn't actually stop you - it just doesn't do what you think it does.

So what's the difference?

Briefly, when you override a method, you still get the benefits of run-time polymorphism, and when you hide, you don't. So what does that mean? Take a look at this code:


class Foo {
    public static void classMethod() {
        System.out.println("classMethod() in Foo");
    }

    public void instanceMethod() {
        System.out.println("instanceMethod() in Foo");
    }
}

class Bar extends Foo {
    public static void classMethod() {
        System.out.println("classMethod() in Bar");
    }

    public void instanceMethod() {
        System.out.println("instanceMethod() in Bar");
    }
}
 
class Test {
    public static void main(String[] args) {
        Foo f = new Bar();
        f.instanceMethod();
        f.classMethod();
    }
}

If you run this, the output is

instanceMethod() in Bar classMethod() in Foo

Why do we get instanceMethod from Bar, but classMethod() from Foo? Aren't we using the same instance f to access both of these? Yes we are - but since one is overriding and the other is hiding, we see different behavior.

Since instanceMethod() is (drum roll please...) an instance method, in which Bar overrides the method from Foo, at run time the JVM uses the actual class of the instance f to determine which method to run. Although f was declared as a Foo, the actual instance we created was a new Bar(). So at runtime, the JVM finds that f is a Bar instance, and so it calls instanceMethod() in Bar rather than the one in Foo. That's how Java normally works for instance methods.

With classMethod() though. since (ahem) it's a class method, the compiler and JVM don't expect to need an actual instance to invoke the method. And even if you provide one (which we did: the instance referred to by f) the JVM will never look at it. The compiler will only look at the declared type of the reference, and use that declared type to determine, at compile time, which method to call. Since f is declared as type Foo, the compiler looks at f.classMethod() and decides it means Foo.classMethod. It doesn't matter that the instance reffered to by f is actually a Bar - for static methods, the compiler only uses the declared type of the reference. That's what we mean when we say a static method does not have run-time polymorphism.

Because instance methods and class methods have this important difference in behavior, we use different terms - "overriding" for instance methods and "hiding" for class methods - to distinguish between the two cases. And when we say you can't override a static method, what that means is that even if you write code that looks like it's overriding a static method (like the first Foo and Bar at the top of this page) - it won't behave like an overridden method.

So what about accessing a static method using an instance?

It's possible in Java to write something like:

   f.classMethod();

where f is an instance of some class, and classMethod() is a class method (i.e. a static method) of that class. This is legal, but it's a bad idea because it creates confusion. The actual instance f is not really important here. Only the declared type of f matters. That is, what class is f declared to be? Since classMethod() is static, the class of f (as determined by the compiler at compile time) is all we need.

Rather than writing:

    f.classMethod();
It would be better coding style to write either:
    Foo.classMethod();
or
    Bar.classMethod(); 
That way, it is crystal clear which class method you would like to call. It is also clear that the method you are calling is indeed a class method.

Barring that, you could always come up with this monstrosity:

    f.getClass().getMethod("classMethod", new Class[]).invoke(null, new Object[]);

But all this could be avoided by simply not trying to override your static (class) methods. :-)

Why does the compiler sometimes talk about overriding static methods?

Sometimes you will see error messages from the compiler that talk about overriding static methods. Apparently, whoever writes these particular messages has not read the Java Language Specification and does not know the difference between overriding and hiding. So they use incorrect and misleading terminology. Just ignore it. The Java Language Specification is very clear about the difference between overriding and hiding, even if the compiler messages are not. Just pretend that the compiler said "hide" rather than "override"..

ref: //www.coderanch.com/how-to/java/OverridingVsHiding



gembin 2014-05-29 15:52 鍙戣〃璇勮
]]>
Fuck GFW - ▼幸运赛车规则▼幸运赛车投注▼幸运赛车开奖结果查询▼湖南幸运赛车开奖奖金▼幸运赛车走势▼//www.cqk4s.cn/gembin/archive/2014/05/18/413795.htmlgembingembinSat, 17 May 2014 16:21:00 GMT//www.cqk4s.cn/gembin/archive/2014/05/18/413795.html//www.cqk4s.cn/gembin/comments/413795.html//www.cqk4s.cn/gembin/archive/2014/05/18/413795.html#Feedback1//www.cqk4s.cn/gembin/comments/commentRss/413795.html//www.cqk4s.cn/gembin/services/trackbacks/413795.html Just one word: FUCK!! 
Two words: FUCK YOU!! 
Three words: FUCK YOU Forever!! 

I JUST want to access github !! WHY is this! GFW锛宼he son of a bitch!!!!
 

gembin 2014-05-18 00:21 鍙戣〃璇勮
]]>
A web-based monitoring tool for WebSphere MQ - ▼幸运赛车规则▼幸运赛车投注▼幸运赛车开奖结果查询▼湖南幸运赛车开奖奖金▼幸运赛车走势▼//www.cqk4s.cn/gembin/archive/2013/12/04/407231.htmlgembingembinWed, 04 Dec 2013 15:22:00 GMT//www.cqk4s.cn/gembin/archive/2013/12/04/407231.html//www.cqk4s.cn/gembin/comments/407231.html//www.cqk4s.cn/gembin/archive/2013/12/04/407231.html#Feedback0//www.cqk4s.cn/gembin/comments/commentRss/407231.html//www.cqk4s.cn/gembin/services/trackbacks/407231.html
My developerWorks article on WebSphere MQ


gembin 2013-12-04 23:22 鍙戣〃璇勮
]]>
How JavaScript Timers Work - ▼幸运赛车规则▼幸运赛车投注▼幸运赛车开奖结果查询▼湖南幸运赛车开奖奖金▼幸运赛车走势▼//www.cqk4s.cn/gembin/archive/2013/05/27/399816.htmlgembingembinMon, 27 May 2013 05:50:00 GMT//www.cqk4s.cn/gembin/archive/2013/05/27/399816.html//www.cqk4s.cn/gembin/comments/399816.html//www.cqk4s.cn/gembin/archive/2013/05/27/399816.html#Feedback0//www.cqk4s.cn/gembin/comments/commentRss/399816.html//www.cqk4s.cn/gembin/services/trackbacks/399816.htmlAt a fundamental level it’s important to understand how JavaScript timers work. Often times they behave unintuitively because of the single thread which they are in. Let’s start by examining the three functions to which we have access that can construct and manipulate timers.

  • var id = setTimeout(fn, delay); – Initiates a single timer which will call the specified function after the delay. The function returns a unique ID with which the timer can be canceled at a later time.
  • var id = setInterval(fn, delay); – Similar to setTimeout but continually calls the function (with a delay every time) until it is canceled.
  • clearInterval(id);clearTimeout(id); – Accepts a timer ID (returned by either of the aforementioned functions) and stops the timer callback from occurring.

In order to understand how the timers work internally there’s one important concept that needs to be explored: timer delay is not guaranteed. Since all JavaScript in a browser executes on a single thread asynchronous events (such as mouse clicks and timers) are only run when there’s been an opening in the execution. This is best demonstrated with a diagram, like in the following:


(Click to view full size diagram)

There’s a lot of information in this figure to digest but understanding it completely will give you a better realization of how asynchronous JavaScript execution works. This diagram is one dimensional: vertically we have the (wall clock) time, in milliseconds. The blue boxes represent portions of JavaScript being executed. For example the first block of JavaScript executes for approximately 18ms, the mouse click block for approximately 11ms, and so on.

Since JavaScript can only ever execute one piece of code at a time (due to its single-threaded nature) each of these blocks of code are “blocking” the progress of other asynchronous events. This means that when an asynchronous event occurs (like a mouse click, a timer firing, or an XMLHttpRequest completing) it gets queued up to be executed later (how this queueing actually occurs surely varies from browser-to-browser, so consider this to be a simplification).

To start with, within the first block of JavaScript, two timers are initiated: a 10mssetTimeout and a 10ms setInterval. Due to where and when the timer was started it actually fires before we actually complete the first block of code. Note, however, that it does not execute immediately (it is incapable of doing that, because of the threading). Instead that delayed function is queued in order to be executed at the next available moment.

Additionally, within this first JavaScript block we see a mouse click occur. The JavaScript callbacks associated with this asynchronous event (we never know when a user may perform an action, thus it’s consider to be asynchronous) are unable to be executed immediately thus, like the initial timer, it is queued to be executed later.

After the initial block of JavaScript finishes executing the browser immediately asks the question: What is waiting to be executed? In this case both a mouse click handler and a timer callback are waiting. The browser then picks one (the mouse click callback) and executes it immediately. The timer will wait until the next possible time, in order to execute.

Note that while mouse click handler is executing the first interval callback executes. As with the timer its handler is queued for later execution. However, note that when the interval is fired again (when the timer handler is executing) this time that handler execution is dropped. If you were to queue up all interval callbacks when a large block of code is executing the result would be a bunch of intervals executing with no delay between them, upon completion. Instead browsers tend to simply wait until no more interval handlers are queued (for the interval in question) before queuing more.

We can, in fact, see that this is the case when a third interval callback fires while the interval, itself, is executing. This shows us an important fact: Intervals don’t care about what is currently executing, they will queue indiscriminately, even if it means that the time between callbacks will be sacrificed.

Finally, after the second interval callback is finished executing, we can see that there’s nothing left for the JavaScript engine to execute. This means that the browser now waits for a new asynchronous event to occur. We get this at the 50ms mark when the interval fires again. This time, however, there is nothing blocking its execution, so it fires immediately.

Let’s take a look at an example to better illustrate the differences betweensetTimeout and setInterval.

  1. setTimeout(function(){
  2.     /* Some long block of code... */
  3.     setTimeout(arguments.callee, 10);
  4.   }, 10);
  5.  
  6.   setInterval(function(){
  7.     /* Some long block of code... */
  8.   }, 10);

These two pieces of code may appear to be functionally equivalent, at first glance, but they are not. Notably the setTimeout code will always have at least a 10ms delay after the previous callback execution (it may end up being more, but never less) whereas the setInterval will attempt to execute a callback every 10ms regardless of when the last callback was executed.

There’s a lot that we’ve learned here, let’s recap:

  • JavaScript engines only have a single thread, forcing asynchronous events to queue waiting for execution.
  • setTimeout and setInterval are fundamentally different in how they execute asynchronous code.
  • If a timer is blocked from immediately executing it will be delayed until the next possible point of execution (which will be longer than the desired delay).
  • Intervals may execute back-to-back with no delay if they take long enough to execute (longer than the specified delay).

All of this is incredibly important knowledge to build off of. Knowing how a JavaScript engine works, especially with the large number of asynchronous events that typically occur, makes for a great foundation when building an advanced piece of application code.

from: //ejohn.org/blog/how-javascript-timers-work/




gembin 2013-05-27 13:50 鍙戣〃璇勮
]]>
Tip of changing the language settings for Websphere MQ Explorer - ▼幸运赛车规则▼幸运赛车投注▼幸运赛车开奖结果查询▼湖南幸运赛车开奖奖金▼幸运赛车走势▼//www.cqk4s.cn/gembin/archive/2013/03/23/396905.htmlgembingembinSat, 23 Mar 2013 09:26:00 GMT//www.cqk4s.cn/gembin/archive/2013/03/23/396905.html//www.cqk4s.cn/gembin/comments/396905.html//www.cqk4s.cn/gembin/archive/2013/03/23/396905.html#Feedback0//www.cqk4s.cn/gembin/comments/commentRss/396905.html//www.cqk4s.cn/gembin/services/trackbacks/396905.htmlOpen <InstallDir>/MQExplorer/eclipse/configuration/config.ini
Add these two lines before eof

org.osgi.framework.language=en
osgi.nl=en_US


gembin 2013-03-23 17:26 鍙戣〃璇勮
]]>
Mac鎶宸т箣璁︰鐩樸佺Щ鍔ㄧ‖鐩樺湪鑻规灉鐢佃剳鍜學indows PC閮借兘璇嗗埆/璇诲啓锛屼笖鏀寔4GB澶ф枃浠讹細exFAT鏍煎紡 - ▼幸运赛车规则▼幸运赛车投注▼幸运赛车开奖结果查询▼湖南幸运赛车开奖奖金▼幸运赛车走势▼//www.cqk4s.cn/gembin/archive/2013/03/12/396297.htmlgembingembinMon, 11 Mar 2013 17:27:00 GMT//www.cqk4s.cn/gembin/archive/2013/03/12/396297.html//www.cqk4s.cn/gembin/comments/396297.html//www.cqk4s.cn/gembin/archive/2013/03/12/396297.html#Feedback0//www.cqk4s.cn/gembin/comments/commentRss/396297.html//www.cqk4s.cn/gembin/services/trackbacks/396297.html 濡傛灉鎮ㄧ殑 U 鐩樸佺Щ鍔ㄧ‖鐩樻棦瑕佺敤浜?PC 鍙堣鐢ㄤ簬鑻规灉鐢佃剳锛孧ac OS X 绯荤粺鐨?HFS锛?鍜?Windows 鐨?NTFS 鏍煎紡鏄剧劧閮戒笉琛?#8230;…HFS+ 鍦?Windows 涓嬩笉璇嗗埆锛孨TFS 鏍煎紡鐨?U 鐩樸佺Щ鍔ㄧ‖鐩樻彃鍦ㄨ嫻鏋滅數鑴戜笂鍙兘璇讳笉鑳藉啓銆傛牸寮忓寲鎴?FAT32 鏄剧劧鍙互鏀寔涓や釜绯荤粺锛屼絾鍗曚竴鏂囦欢澶т簬 4GB 灏辨瓏鑿溿?/span>

exFAT 鏍煎紡

    浣嗚嫻鏋滅數鑴?Mac OS X 10.6.5 绯荤粺鍋氬嚭浜嗕竴椤规剰涔夐噸澶х殑鍗囩骇锛氭敮鎸?exFAT 纾佺洏鏍煎紡锛屾牸寮忓寲鎴?exFAT 鏍煎紡鐨?U 鐩樸佺Щ鍔ㄧ‖鐩樺湪 Windows PC 涓婂拰鑻规灉鐢佃剳 Mac OS X 绯荤粺涓嬪潎鑳借鍐欙紝鑰屼笖鏀寔瓒呰繃鍗曚釜浣撶Н瓒呰繃 4 GB 鐨勫ぇ鏂囦欢銆?/p>

    涓嬮潰鏄皢 U 鐩樸佺Щ鍔ㄧ‖鐩樻牸寮忓寲鎴?exFAT 鏍煎紡鐨勬柟娉曪紝浠ュ強 exFAT銆丗AT32銆丠FS锛?涓夌鏍煎紡涓嬪悓涓鍧?U 鐩樼殑璇诲啓閫熷害娴嬭瘯

鑻规灉鐢佃剳 Mac OS X 绯荤粺涓嬫妸U鐩樸佺Щ鍔ㄧ‖鐩樻牸寮忓寲鎴恊xFAT鏍煎紡
鑻规灉鐢佃剳 Mac OS X 绯荤粺涓嬫妸U鐩樸佺Щ鍔ㄧ‖鐩樻牸寮忓寲鎴恊xFAT鏍煎紡

    鐐瑰嚮鑻规灉鐢佃剳灞忓箷鍙充笂瑙掔殑鏀惧ぇ闀滄寜閽紝Sportlight 鎼滅储“纾佺洏宸ュ叿”锛屽湪纾佺洏宸ュ叿渚ц竟鏍忛夋嫨瑕佹牸寮忓寲鐨?U 鐩樻垨绉诲姩纭洏鍒嗗尯锛屽彸渚ч夋嫨“鎶规帀”鏍囩锛屽湪鏍煎紡涓嬫媺鑿滃崟閲岄夋嫨 ExFAT 鍗冲彲銆傚涓婂浘鎵绀恒?/p>

Windows 绯荤粺涓嬫妸U鐩樸佺Щ鍔ㄧ‖鐩樻牸寮忓寲鎴恊xFAT鏍煎紡
Windows 绯荤粺涓嬫妸U鐩樸佺Щ鍔ㄧ‖鐩樻牸寮忓寲鎴恊xFAT鏍煎紡

    Windows 7 鍜?Vista 榛樿灏辨敮鎸?exFAT 鏍煎紡锛屽鏋滄槸 XP 绯荤粺锛岃涓嬭浇 KB955704 琛ヤ竵锛?u style="margin: 0px auto; padding: 0px;">//www.microsoft.com/downloads/details.aspx?displaylang=zh-cn&FamilyID=1cbe3906-ddd1-4ca2-b727-c2dff5e30f61

    鑷充簬 exFAT 鏍煎紡鐨?U 鐩樼殑璇诲啓閫熷害锛屼笅闈㈡槸鍚屼竴鍧?U 鐩樺湪鍚屼竴鍙扮數鑴戯紙鎴戠殑 Macbook Pro锛変笂鐨勮鍐欓熷害娴嬭瘯锛屾祴璇曡蒋浠朵负 浠ュ墠浠嬬粛鐨勫厤璐硅蒋浠讹細AJA System Test銆?br style="margin: 0px auto; padding: 0px;" />

FAT32銆丠FS锛嬨乪xFAT 鏍煎紡鐨?U 鐩樿鍐欓熷害娴嬭瘯
FAT32銆丠FS锛嬨乪xFAT 鏍煎紡鐨?U 鐩樿鍐欓熷害娴嬭瘯

    椤烘椂閽堜緷娆℃槸 FAT32銆丠FS锛嬨乪xFAT 鏍煎紡涓?U 鐩樿鍐欓熷害娴嬭瘯缁撴灉锛屼笉澶銆傛墍浠ワ細鍙妸 U 鐩樺拰绉诲姩纭洏鐨勪竴涓垎鍖猴紙涓撻棬鐢ㄤ簬 PC銆丮ac 涔嬮棿浜ゆ崲鏂囦欢锛夋牸寮忓寲鎴?exFAT 灏辫浜嗐?br />KEEP FOR REF: //www.mac52ipod.cn/post/use-u-disk-hdd-on-windows-pc-and-mac-os-x-4gb-exfat.php



gembin 2013-03-12 01:27 鍙戣〃璇勮
]]>
JPA Concepts - ▼幸运赛车规则▼幸运赛车投注▼幸运赛车开奖结果查询▼湖南幸运赛车开奖奖金▼幸运赛车走势▼//www.cqk4s.cn/gembin/archive/2013/03/07/396169.htmlgembingembinThu, 07 Mar 2013 08:58:00 GMT//www.cqk4s.cn/gembin/archive/2013/03/07/396169.html//www.cqk4s.cn/gembin/comments/396169.html//www.cqk4s.cn/gembin/archive/2013/03/07/396169.html#Feedback0//www.cqk4s.cn/gembin/comments/commentRss/396169.html//www.cqk4s.cn/gembin/services/trackbacks/396169.html
keep it for reference
//tomee.apache.org/jpa-concepts.html
//www.jpalace.org/docs/tutorials/jee/jpa_2.html


gembin 2013-03-07 16:58 鍙戣〃璇勮
]]>
JPA Criteria API - ▼幸运赛车规则▼幸运赛车投注▼幸运赛车开奖结果查询▼湖南幸运赛车开奖奖金▼幸运赛车走势▼//www.cqk4s.cn/gembin/archive/2013/03/06/396131.htmlgembingembinWed, 06 Mar 2013 05:44:00 GMT//www.cqk4s.cn/gembin/archive/2013/03/06/396131.html//www.cqk4s.cn/gembin/comments/396131.html//www.cqk4s.cn/gembin/archive/2013/03/06/396131.html#Feedback0//www.cqk4s.cn/gembin/comments/commentRss/396131.html//www.cqk4s.cn/gembin/services/trackbacks/396131.html
Count
CriteriaBuilder critBuilder = entityManager.getCriteriaBuilder();
CriteriaQuery<Long> critQuery = criteriaBuilder.createQuery(Long.class);
Root<Foo> root = critQuery.from(Foo.class);
critQuery.select(critBuilder.countDistinct(root));
int count = entityManager.createQuery(critQuery).getSingleResult().intValue();


 

 Result

CriteriaBuilder critBuilder = entityManager.getCriteriaBuilder(); 
CriteriaQuery<Long> critQuery = criteriaBuilder.createQuery(Long.class);
Root<Foo> root = critQuery.from(Foo.class);
critQuery.select(root).distinct(true);
List<Foo> result = entityManager.createQuery(critQuery).getResultList();


gembin 2013-03-06 13:44 鍙戣〃璇勮
]]>
Adobe Photoshop Source Code - version 1.0.1 - ▼幸运赛车规则▼幸运赛车投注▼幸运赛车开奖结果查询▼湖南幸运赛车开奖奖金▼幸运赛车走势▼//www.cqk4s.cn/gembin/archive/2013/02/14/395312.htmlgembingembinThu, 14 Feb 2013 08:28:00 GMT//www.cqk4s.cn/gembin/archive/2013/02/14/395312.html//www.cqk4s.cn/gembin/comments/395312.html//www.cqk4s.cn/gembin/archive/2013/02/14/395312.html#Feedback0//www.cqk4s.cn/gembin/comments/commentRss/395312.html//www.cqk4s.cn/gembin/services/trackbacks/395312.htmlpho·to·shop, transitive verb, often capitalized \藞f艒-(藢)t艒-藢shäp\

  1. to alter (a digital image) with Photoshop software or other image-editing software especially in a way that distorts reality (as for deliberately deceptive purposes)

– Merriam-Webster online dictionary, 2012

When brothers Thomas and John Knoll began designing and writing an image editing program in the late 1980s, they could not have imagined that they would be adding a word to the dictionary.

Thomas Knoll

John Knoll


Thomas Knoll, a PhD student in computer vision at the University of Michigan, had written a program in 1987 to display and modify digital images. His brother John, working at the movie visual effects company Industrial Light & Magic, found it useful for editing photos, but it wasn’t intended to be a product. Thomas said, “We developed it originally for our own personal use…it was a lot a fun to do.”

Gradually the program, called “Display”, became more sophisticated. In the summer of 1988 they realized that it indeed could be a credible commercial product. They renamed it “Photoshop” and began to search for a company to distribute it. About 200 copies of version 0.87 were bundled by slide scanner manufacturer Barneyscan as “Barneyscan XP”.

The fate of Photoshop was sealed when Adobe, encouraged by its art director Russell Brown, decided to buy a license to distribute an enhanced version of Photoshop. The deal was finalized in April 1989, and version 1.0 started shipping early in 1990.

Over the next ten years, more than 3 million copies of Photoshop were sold.

  That first version of Photoshop was written primarily in Pascal for the Apple Macintosh, with some machine language for the underlying Motorola 68000 microprocessor where execution efficiency was important. It wasn’t the effort of a huge team. Thomas said, “For version 1, I was the only engineer, and for version 2, we had two engineers.” While Thomas worked on the base application program, John wrote many of the image-processing plug-ins.

With the permission of Adobe Systems Inc., the Computer History Museum is pleased to make available, for non-commercial use, the source code to the 1990 version 1.0.1 of Photoshop. All the code is here with the exception of the MacApp applications library that was licensed from Apple. There are 179 files in the zipped folder, comprising about 128,000 lines of mostly uncommented but well-structured code. By line count, about 75% of the code is in Pascal, about 15% is in 68000 assembler language, and the rest is data of various sorts. To download the code you must agree to the terms of the license.

Download Photoshop version 1.0.1 Source Code

The 1990 version of the Adobe Photoshop User Guide is at//www.computerhistory.org/collections/accession/102640940

and the 1990 Adobe Photoshop tutorial is at//www.computerhistory.org/collections/accession/102640945 

Commentary on the source code

Software architect Grady Booch is the Chief Scientist for Software Engineering at IBM Research Almaden and a trustee of the Computer History Museum. He offers the following observations about the Photoshop source code:

“Opening the files that constituted the source code for Photoshop 1.0, I felt a bit like Howard Carter as he first breached the tomb of King Tutankhamen. What wonders awaited me?

I was not disappointed by what I found. Indeed, it was a marvelous journey to open up the cunning machinery of an application I’d first used over 20 years ago.

Architecturally, this is a very well-structured system. There’s a consistent separation of interface and abstraction, and the design decisions made to componentize those abstractions – with generally one major type for each combination of interface and implementation — were easy to follow.

The abstractions are quite mature. The consistent naming, the granularity of methods, the almost breathtaking simplicity of the implementations because each type was so well abstracted, all combine to make it easy to discern the texture of the system.

Having the opportunity to examine Photoshop’s current architecture, I believe I see fundamental structures that have persisted, though certainly in more evolved forms, in the modern implementation. Tiles, filters, abstractions for virtual memory (to attend to images far larger than display buffers or main memory could normally handle) are all there in the first version. Yet it had just over 100,000 lines of code, compared to well over 10 million in the current version! Then and now, much of the code is related to input/output and the myriad of file formats that Photoshop has to attend to.

There are only a few comments in the version 1.0 source code, most of which are associated with assembly language snippets. That said, the lack of comments is simply not an issue. This code is so literate, so easy to read, that comments might even have gotten in the way.

It is delightful to find historical vestiges of the time: code to attend to Andy Herzfield’s software for the Thunderscan scanner, support of early TARGA raster graphics file types, and even a few passing references to Barneyscan lie scattered about in the code. These are very small elements of the overall code base, but their appearance reminds me that no code is an island.

This is the kind of code I aspire to write.”

And this is the kind of code we all can learn from. Software source code is the literature of computer scientists, and it deserves to be studied and appreciated. Enjoy a view of Photoshop from the inside.

 

Early Photoshop screenshots*

 

The home screen, showing the available tools.

 

Photoshop allowed you to select brush color as well as size and texture. (The first color Mac was the Macintosh II in 1987.)

 

There were some sophisticated selection tools, and a good assortment of image filters. One important missing feature, which came with version 3 in 1994, was the ability to divide an image into multiple layers.

 

The preferences page allowed for some customization of the features.

 

There was a limited choice of fonts, font sizes, and font styles. The text was entered into this dialog box, then moved into the image.

*Screen shots courtesy of creativebits, www.creativebits.org.
from:  
//computerhistory.org/atchm/adobe-photoshop-source-code/



gembin 2013-02-14 16:28 鍙戣〃璇勮
]]>
Thread-safety when injecting JPA EntityManager - ▼幸运赛车规则▼幸运赛车投注▼幸运赛车开奖结果查询▼湖南幸运赛车开奖奖金▼幸运赛车走势▼//www.cqk4s.cn/gembin/archive/2013/02/04/395088.htmlgembingembinMon, 04 Feb 2013 02:49:00 GMT//www.cqk4s.cn/gembin/archive/2013/02/04/395088.html//www.cqk4s.cn/gembin/comments/395088.html//www.cqk4s.cn/gembin/archive/2013/02/04/395088.html#Feedback0//www.cqk4s.cn/gembin/comments/commentRss/395088.html//www.cqk4s.cn/gembin/services/trackbacks/395088.html闃呰鍏ㄦ枃

gembin 2013-02-04 10:49 鍙戣〃璇勮
]]>
Java Exception Practices - ▼幸运赛车规则▼幸运赛车投注▼幸运赛车开奖结果查询▼湖南幸运赛车开奖奖金▼幸运赛车走势▼//www.cqk4s.cn/gembin/archive/2012/12/26/393525.htmlgembingembinWed, 26 Dec 2012 15:56:00 GMT//www.cqk4s.cn/gembin/archive/2012/12/26/393525.html//www.cqk4s.cn/gembin/comments/393525.html//www.cqk4s.cn/gembin/archive/2012/12/26/393525.html#Feedback1//www.cqk4s.cn/gembin/comments/commentRss/393525.html//www.cqk4s.cn/gembin/services/trackbacks/393525.htmlJust keep it for reference.

Best Practices for Exception Handling
//onjava.com/pub/a/onjava/2003/11/19/exceptions.html

The Trouble with Checked Exceptions
//www.artima.com/intv/handcuffs.html

Exception-Handling Antipatterns
//today.java.net/pub/a/today/2006/04/06/exception-handling-antipatterns.html

Exception management and error tracking in J2EE
//www.javaworld.com/javaworld/jw-07-2005/jw-0711-exception.html?page=1

Exceptional practices
//www.javaworld.com/javaworld/jw-12-2001/jw-1221-exceptions.html?page=1

Exception Handling
//www.objectsource.com/j2eechapters/Ch18-Exception_Handling.htm

Spring MVC REST Exception Handling Best Practices 
//www.stormpath.com/blog/spring-mvc-rest-exception-handling-best-practices-part-1
//www.stormpath.com/blog/spring-mvc-rest-exception-handling-best-practices-part-2


gembin 2012-12-26 23:56 鍙戣〃璇勮
]]>
The Trouble with Checked Exceptions - ▼幸运赛车规则▼幸运赛车投注▼幸运赛车开奖结果查询▼湖南幸运赛车开奖奖金▼幸运赛车走势▼//www.cqk4s.cn/gembin/archive/2012/12/26/393523.htmlgembingembinWed, 26 Dec 2012 15:35:00 GMT//www.cqk4s.cn/gembin/archive/2012/12/26/393523.html//www.cqk4s.cn/gembin/comments/393523.html//www.cqk4s.cn/gembin/archive/2012/12/26/393523.html#Feedback0//www.cqk4s.cn/gembin/comments/commentRss/393523.html//www.cqk4s.cn/gembin/services/trackbacks/393523.htmlSummary
Anders Hejlsberg, the lead C# architect, talks with Bruce Eckel and Bill Venners about versionability and scalability issues with checked exceptions.

Anders Hejlsberg, a distinguished engineer at Microsoft, led the team that designed the C# (pronounced C Sharp) programming language. Hejlsberg first vaulted onto the software world stage in the early eighties by creating a Pascal compiler for MS-DOS and CP/M. A very young company called Borland soon hired Hejlsberg and bought his compiler, which was thereafter marketed as Turbo Pascal. At Borland, Hejlsberg continued to develop Turbo Pascal and eventually led the team that designed Turbo Pascal's replacement: Delphi. In 1996, after 13 years with Borland, Hejlsberg joined Microsoft, where he initially worked as an architect of Visual J++ and the Windows Foundation Classes (WFC). Subsequently, Hejlsberg was chief designer of C# and a key participant in the creation of the .NET framework. Currently, Anders Hejlsberg leads the continued development of the C# programming language.

On July 30, 2003, Bruce Eckel, author of Thinking in C++ and Thinking in Java, and Bill Venners, editor-in-chief of Artima.com, met with Anders Hejlsberg in his office at Microsoft in Redmond, Washington. In this interview, which will be published in multiple installments on Artima.com and on an audio CD-ROM to be released this fall by Bruce Eckel, Anders Hejlsberg discusses many design choices of the C# language and the .NET framework.

  • In Part I: The C# Design Process, Hejlsberg discusses the process used by the team that designed C#, and the relative merits of usability studies and good taste in language design.
  • In this second installment, Hejlsberg discusses versionability and scalability issues with checked exceptions.

    湖南幸运赛车直播官网:Remaining Neutral on Checked Exceptions

    Bruce Eckel: C# doesn't have checked exceptions. How did you decide whether or not to put checked exceptions into C#?

    Anders Hejlsberg: I see two big issues with checked exceptions: scalability and versionability. I know you've written some about checked exceptions too, and you tend to agree with our line of thinking.

    Bruce Eckel: I used to think that checked exceptions were really great.

    Anders Hejlsberg: Exactly. Frankly, they look really great up front, and there's nothing wrong with the idea. I completely agree that checked exceptions are a wonderful feature. It's just that particular implementations can be problematic. By implementing checked exceptions the way it's done in Java, for example, I think you just take one set of problems and trade them for another set of problems. In the end it's not clear to me that you actually make life any easier. You just make it different.

    Bruce Eckel: Was there a lot of disagreement in the C# design team about checked excpetions?

    Anders Hejlsberg: No, I think there was fairly broad agreement in our design group.

    C# is basically silent on the checked exceptions issue. Once a better solution is known—and trust me we continue to think about it—we can go back and actually put something in place. I'm a strong believer that if you don't have anything right to say, or anything that moves the art forward, then you'd better just be completely silent and neutral, as opposed to trying to lay out a framework.

    If you ask beginning programmers to write a calendar control, they often think to themselves, "Oh, I'm going to write the world's best calendar control! It's going to be polymorphic with respect to the kind of calendar. It will have displayers, and mungers, and this, that, and the other." They need to ship a calendar application in two months. They put all this infrastructure into place in the control, and then spend two days writing a crappy calendar application on top of it. They'll think, "In the next version of the application, I'm going to do so much more."

    Once they start thinking about how they're actually going to implement all of these other concretizations of their abstract design, however, it turns out that their design is completely wrong. And now they've painted themself into a corner, and they have to throw the whole thing out. I have seen that over and over. I'm a strong believer in being minimalistic. Unless you actually are going to solve the general problem, don't try and put in place a framework for solving a specific one, because you don't know what that framework should look like.

    Bruce Eckel: The Extreme Programmers say, "Do the simplest thing that could possibly work."

    Anders Hejlsberg: Yeah, well, Einstein said that, "Do the simplest thing possible, but no simpler." The concern I have about checked exceptions is the handcuffs they put on programmers. You see programmers picking up new APIs that have all these throws clauses, and then you see how convoluted their code gets, and you realize the checked exceptions aren't helping them any. It is sort of these dictatorial API designers telling you how to do your exception handling. They should not be doing that.

    Versioning with Checked Exceptions

    Bill Venners: You mentioned scalability and versioning concerns with respect to checked exceptions. Could you clarify what you mean by those two issues?

    Anders Hejlsberg: Let's start with versioning, because the issues are pretty easy to see there. Let's say I create a method foo that declares it throws exceptions AB, and C. In version two of foo, I want to add a bunch of features, and now foo might throw exception D. It is a breaking change for me to add D to the throws clause of that method, because existing caller of that method will almost certainly not handle that exception.

    Adding a new exception to a throws clause in a new version breaks client code. It's like adding a method to an interface. After you publish an interface, it is for all practical purposes immutable, because any implementation of it might have the methods that you want to add in the next version. So you've got to create a new interface instead. Similarly with exceptions, you would either have to create a whole new method called foo2 that throws more exceptions, or you would have to catch exception D in the new foo, and transform the D into an A,B, or C.

    Bill Venners: But aren't you breaking their code in that case anyway, even in a language without checked exceptions? If the new version of foo is going to throw a new exception that clients should think about handling, isn't their code broken just by the fact that they didn't expect that exception when they wrote the code?

    Anders Hejlsberg: No, because in a lot of cases, people don't care. They're not going to handle any of these exceptions. There's a bottom level exception handler around their message loop. That handler is just going to bring up a dialog that says what went wrong and continue. The programmers protect their code by writing try finally's everywhere, so they'll back out correctly if an exception occurs, but they're not actually interested in handling the exceptions.

    The throws clause, at least the way it's implemented in Java, doesn't necessarily force you to handle the exceptions, but if you don't handle them, it forces you to acknowledge precisely which exceptions might pass through. It requires you to either catch declared exceptions or put them in your own throws clause. To work around this requirement, people do ridiculous things. For example, they decorate every method with, "throws Exception." That just completely defeats the feature, and you just made the programmer write more gobbledy gunk. That doesn't help anybody.

    Bill Venners: So you think the more common case is that callers don't explicitly handle exceptions in deference to a general catch clause further up the call stack?

    Anders Hejlsberg: It is funny how people think that the important thing about exceptions is handling them. That is not the important thing about exceptions. In a well-written application there's a ratio of ten to one, in my opinion, of try finally to try catch. Or in C#, using statements, which are like try finally.

    Bill Venners: What's in the finally?

    Anders Hejlsberg: In the finally, you protect yourself against the exceptions, but you don't actually handle them. Error handling you put somewhere else. Surely in any kind of event-driven application like any kind of modern UI, you typically put an exception handler around your main message pump, and you just handle exceptions as they fall out that way. But you make sure you protect yourself all the way out by deallocating any resources you've grabbed, and so forth. You clean up after yourself, so you're always in a consistent state. You don't want a program where in 100 different places you handle exceptions and pop up error dialogs. What if you want to change the way you put up that dialog box? That's just terrible. The exception handling should be centralized, and you should just protect yourself as the exceptions propagate out to the handler.

    The Scalability of Checked Exceptions

    Bill Venners: What is the scalability issue with checked exceptions?

    Anders Hejlsberg: The scalability issue is somewhat related to the versionability issue. In the small, checked exceptions are very enticing. With a little example, you can show that you've actually checked that you caught the FileNotFoundException, and isn't that great? Well, that's fine when you're just calling one API. The trouble begins when you start building big systems where you're talking to four or five different subsystems. Each subsystem throws four to ten exceptions. Now, each time you walk up the ladder of aggregation, you have this exponential hierarchy below you of exceptions you have to deal with. You end up having to declare 40 exceptions that you might throw. And once you aggregate that with another subsystem you've got 80 exceptions in your throws clause. It just balloons out of control.

    In the large, checked exceptions become such an irritation that people completely circumvent the feature. They either say, "throws Exception," everywhere; or—and I can't tell you how many times I've seen this—they say, "try, da da da da da, catch curly curly." They think, "Oh I'll come back and deal with these empty catch clauses later," and then of course they never do. In those situations, checked exceptions have actually degraded the quality of the system in the large.

    And so, when you take all of these issues, to me it just seems more thinking is needed before we put some kind of checked exceptions mechanism in place for C#. But that said, there's certainly tremendous value in knowing what exceptions can get thrown, and having some sort of tool that checks. I don't think we can construct hard and fast rules down to, it is either a compiler error or not. But I think we can certainly do a lot with analysis tools that detect suspicious code, including uncaught exceptions, and points out those potential holes to you.

    from:  //www.artima.com/intv/handcuffs.html



gembin 2012-12-26 23:35 鍙戣〃璇勮
]]>
CentOS 6 瀹夎鍚庡熀鏈厤缃?/title><link>//www.cqk4s.cn/gembin/archive/2012/12/23/393380.html</link><dc:creator>gembin</dc:creator><author>gembin</author><pubDate>Sun, 23 Dec 2012 14:57:00 GMT</pubDate><guid>//www.cqk4s.cn/gembin/archive/2012/12/23/393380.html</guid><wfw:comment>//www.cqk4s.cn/gembin/comments/393380.html</wfw:comment><comments>//www.cqk4s.cn/gembin/archive/2012/12/23/393380.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>//www.cqk4s.cn/gembin/comments/commentRss/393380.html</wfw:commentRss><trackback:ping>//www.cqk4s.cn/gembin/services/trackbacks/393380.html</trackback:ping><description><![CDATA[<p style="font-family: verdana; font-size: 13px; line-height: normal; background-color: #ffffff; "><strong class="vpdh">1</strong><strong class="vpdh">锛庣綉缁滈厤缃?/strong></p><p style="font-family: verdana; font-size: 13px; line-height: normal; background-color: #ffffff; ">锛?锛夊懡浠ら厤缃?br /># ifconfig eth0 192.168.0.2 netmask 255.255.255.0 銆銆//ip鍦板潃銆佸瓙缃戞帺鐮?br /># route add default gw 192.168.0.1 dev eth0銆銆//缃戝叧<br /># hostname centos 銆銆//璁$畻鏈哄悕</p><p style="font-family: verdana; font-size: 13px; line-height: normal; background-color: #ffffff; ">锛?锛夋枃浠堕厤缃?br /><1>淇敼IP鍦板潃<br />淇敼瀵瑰簲缃戝崱鐨処P鍦板潃鐨勯厤缃枃浠?br /># vi /etc/sysconfig/network-scripts/ifcfg-eth0<br />DEVICE=eth0銆(鎻忚堪缃戝崱瀵瑰簲鐨勮澶囧埆鍚嶏紝渚嬪ifcfg-eth0鐨勬枃浠朵腑瀹冧负eth0)<br />BOOTPROTO=static銆(璁剧疆缃戝崱鑾峰緱ip鍦板潃鐨勬柟寮忥紝鍙兘鐨勯夐」涓簊tatic锛宒hcp鎴朾ootp锛屽垎鍒搴旈潤鎬佹寚瀹氱殑ip鍦板潃锛岄氳繃dhcp鍗忚鑾峰緱鐨刬p鍦板潃锛岄氳繃bootp鍗忚鑾峰緱鐨刬p鍦板潃)<br />BROADCAST=192.168.0.255銆(瀵瑰簲鐨勫瓙缃戝箍鎾湴鍧)<br />HWADDR=00:07:E9:05:E8:B4銆 (瀵瑰簲鐨勭綉鍗$墿鐞嗗湴鍧)<br />IPADDR=12.168.1.2銆(濡傛灉璁剧疆缃戝崱鑾峰緱ip鍦板潃鐨勬柟寮忎负闈欐佹寚瀹氾紝姝ゅ瓧娈靛氨鎸囧畾浜嗙綉鍗″搴旂殑ip鍦板潃)<br />IPV6INIT=no銆 (寮鍚垨鍏抽棴IPv6锛涘叧闂璶o锛屽紑鍚痽es)<br />IPV6_AUTOCONF=no銆 (寮鍚垨鍏抽棴IPv6鑷姩閰嶇疆锛涘叧闂璶o锛屽紑鍚痽es)<br />NETMASK=255.255.255.0銆(缃戝崱瀵瑰簲鐨勭綉缁滄帺鐮?<br />NETWORK=192.168.1.0銆(缃戝崱瀵瑰簲鐨勭綉缁滃湴鍧)<br />ONBOOT=yes銆(绯荤粺鍚姩鏃舵槸鍚﹁缃缃戠粶鎺ュ彛锛岃缃负yes鏃讹紝绯荤粺鍚姩鏃舵縺娲绘璁惧)<br /><br /><2>淇敼缃戝叧<br />淇敼瀵瑰簲缃戝崱鐨勭綉鍏崇殑閰嶇疆鏂囦欢<br /># vi /etc/sysconfig/network<br />NETWORKING=yes銆(琛ㄧず绯荤粺鏄惁浣跨敤缃戠粶锛屼竴鑸缃负yes銆傚鏋滆涓簄o锛屽垯涓嶈兘浣跨敤缃戠粶锛岃屼笖寰堝绯荤粺鏈嶅姟绋嬪簭灏嗘棤娉曞惎鍔?<br />HOSTNAME=centos銆(璁剧疆鏈満鐨勪富鏈哄悕锛岃繖閲岃缃殑涓绘満鍚嶈鍜?etc/hosts涓缃殑涓绘満鍚嶅搴?<br />GATEWAY=192.168.1.1銆(璁剧疆鏈満杩炴帴鐨勭綉鍏崇殑IP鍦板潃銆備緥濡傦紝缃戝叧涓?0.0.0.2)<br /><br /><3>淇敼DNS<br />淇敼瀵瑰簲缃戝崱鐨凞NS鐨勯厤缃枃浠?br /># vi /etc/resolv.conf<br />nameserver 202.101.224.68銆(鍩熷悕鏈嶅姟鍣?<br />nameserver 202.101.224.69銆(鍩熷悕鏈嶅姟鍣?<br /><br /><4>閲嶆柊鍚姩缃戠粶閰嶇疆<br /># service network restart<br />鎴?br /># /etc/init.d/network restart<br /><br /><strong class="vpdh">2</strong><strong class="vpdh">锛庤蒋浠舵簮閰嶇疆</strong></p><p style="font-family: verdana; font-size: 13px; line-height: normal; background-color: #ffffff; ">鍥藉唴閫熷害杈冨揩鐨勫父鐢ㄦ洿鏂版簮濡備笅锛?br />//mirrors.163.com/centos/ 163-缃戞槗<br />//mirrors.ta139.com/centos/ 涓浗绉诲姩閫氫俊锛堝北涓滅Щ鍔級<br />//centos.ustc.edu.cn/centos/ 涓浗绉戝鎶鏈ぇ瀛?br />//mirror.neu.edu.cn/centos/ 涓滃寳澶у</p><p style="font-family: verdana; font-size: 13px; line-height: normal; background-color: #ffffff; "><strong class="vpdh">缂栬緫yum</strong><strong class="vpdh">閰嶇疆鏂囦欢锛?nbsp;</strong><br />#vi /etc/yum.repos.d/CentOS-Base.repo<br />[base]<br />name=CentOS-$releasever - Base<br />mirrorlist=//mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os<br />#baseurl=//mirror.centos.org/centos/$releasever/os/$basearch/<br />baseurl=//mirrors.163.com/centos/$releasever/os/$basearch/<br />//mirrors.ta139.com/centos/$releasever/os/$basearch/<br />//centos.ustc.edu.cn/centos/$releasever/os/$basearch/<br />//mirror.neu.edu.cn/centos/$releasever/os/$basearch/<br />gpgcheck=1<br />gpgkey=//mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6</p><p style="font-family: verdana; font-size: 13px; line-height: normal; background-color: #ffffff; ">#released updates <br />[updates]<br />name=CentOS-$releasever - Updates<br />mirrorlist=//mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates<br />#baseurl=//mirror.centos.org/centos/$releasever/updates/$basearch/<br />baseurl=//mirrors.163.com/centos/$releasever/updates/$basearch/<br />//mirrors.ta139.com/centos/$releasever/updates/$basearch/<br />//centos.ustc.edu.cn/centos/$releasever/updates/$basearch/<br />//mirror.neu.edu.cn/centos/$releasever/updates/$basearch/<br />gpgcheck=1<br />gpgkey=//mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6</p><p style="font-family: verdana; font-size: 13px; line-height: normal; background-color: #ffffff; ">#additional packages that may be useful<br />[extras]<br />name=CentOS-$releasever - Extras<br />mirrorlist=//mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras<br />#baseurl=//mirror.centos.org/centos/$releasever/extras/$basearch/<br />baseurl=//mirrors.163.com/centos/$releasever/extras/$basearch/<br />//mirrors.ta139.com/centos/$releasever/extras/$basearch/<br />//centos.ustc.edu.cn/centos/$releasever/extras/$basearch/<br />//mirror.neu.edu.cn/centos/$releasever/extras/$basearch/<br />gpgcheck=1<br />gpgkey=//mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6</p><p style="font-family: verdana; font-size: 13px; line-height: normal; background-color: #ffffff; ">#additional packages that extend functionality of existing packages<br />[centosplus]<br />name=CentOS-$releasever - Plus<br />mirrorlist=//mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus<br />#baseurl=//mirror.centos.org/centos/$releasever/centosplus/$basearch/<br />baseurl=//mirrors.163.com/centos/$releasever/centosplus/$basearch/<br />//mirrors.ta139.com/centos/$releasever/centosplus/$basearch/<br />//centos.ustc.edu.cn/centos/$releasever/centosplus/$basearch/<br />//mirror.neu.edu.cn/centos/$releasever/centosplus/$basearch/<br />gpgcheck=1<br />enabled=0<br />gpgkey=//mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6</p><p style="font-family: verdana; font-size: 13px; line-height: normal; background-color: #ffffff; ">#contrib - packages by Centos Users<br />[contrib]<br />name=CentOS-$releasever - Contrib<br />mirrorlist=//mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib<br />#baseurl=//mirror.centos.org/centos/$releasever/contrib/$basearch/<br />baseurl=//mirrors.163.com/centos/$releasever/contrib/$basearch/<br />//mirrors.ta139.com/centos/$releasever/contrib/$basearch/<br />//centos.ustc.edu.cn/centos/$releasever/contrib/$basearch/<br />//mirror.neu.edu.cn/centos/$releasever/contrib/$basearch/<br />gpgcheck=1<br />enabled=0<br />gpgkey=//mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6</p><p style="font-family: verdana; font-size: 13px; line-height: normal; background-color: #ffffff; ">鐒跺悗浣跨敤濡備笅鍛戒护鏇存柊鍒版渶鏂扮郴缁燂細</p><p style="font-family: verdana; font-size: 13px; line-height: normal; background-color: #ffffff; ">#rpm –import /etc/pki/rpm-gpg-key*</p><span style="font-family: verdana; font-size: 13px; line-height: normal; background-color: #ffffff; ">#yum upgrade</span><p style="font-family: verdana; font-size: 13px; line-height: normal; background-color: #ffffff; "><strong class="vpdh">3</strong><strong class="vpdh">锛庡畨瑁呰瑷鍖?/strong></p><p style="font-family: verdana; font-size: 13px; line-height: normal; background-color: #ffffff; ">浠庡畨瑁呯洏杩涜瀹夎锛屾壘鍒板搴攔pm鍖咃細<br />fonts-chinese-3.02-9.6.el5.noarch.rpm<br />fonts-ISO8859-2-75dpi-1.0-17.1.noarch.rpm</p><p style="font-family: verdana; font-size: 13px; line-height: normal; background-color: #ffffff; ">鍙互閫氳繃yum杩涜瀹夎锛屽畨瑁呭姙娉曚负锛?br />#yum groupinstall <language>-support</p><p style="font-family: verdana; font-size: 13px; line-height: normal; background-color: #ffffff; ">鍦?涓婇潰鐨勫懡浠や腑锛?lt;language> 鏄笅鍒椾箣涓: assamese, bengali, chinese, gujarati, hindi, japanese, kannada, korean, malayalam, marathi, oriya, punjabi, sinhala, tamil, thai, 鎴?telegu銆?/p><p style="font-family: verdana; font-size: 13px; line-height: normal; background-color: #ffffff; "><strong class="vpdh">4</strong><strong class="vpdh">锛庤В鍘嬬缉杞欢 </strong><br />#yum install unrar unzip p7zip-full</p><img src ="//www.cqk4s.cn/gembin/aggbug/393380.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="//www.cqk4s.cn/gembin/" target="_blank">gembin</a> 2012-12-23 22:57 <a href="//www.cqk4s.cn/gembin/archive/2012/12/23/393380.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>VirtualBox 瀹夎Centos 涔嬭闂櫄鎷熸満閲岄潰鐨勬湇鍔″彈闃昏В鍐虫柟妗?/title><link>//www.cqk4s.cn/gembin/archive/2012/12/23/393378.html</link><dc:creator>gembin</dc:creator><author>gembin</author><pubDate>Sun, 23 Dec 2012 14:40:00 GMT</pubDate><guid>//www.cqk4s.cn/gembin/archive/2012/12/23/393378.html</guid><wfw:comment>//www.cqk4s.cn/gembin/comments/393378.html</wfw:comment><comments>//www.cqk4s.cn/gembin/archive/2012/12/23/393378.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>//www.cqk4s.cn/gembin/comments/commentRss/393378.html</wfw:commentRss><trackback:ping>//www.cqk4s.cn/gembin/services/trackbacks/393378.html</trackback:ping><description><![CDATA[<p style="margin: 0px 0px 10px; padding: 0px; color: #333333; font-family: 寰蒋闆呴粦, Verdana, Tahoma, 'BitStream vera Sans', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 26px; background-color: #fcfff6; ">鎯呭喌鏄繖鏍风殑锛屾垜瀛︿範cenots涓鐩存槸鍦ㄧ郴缁熶腑閲囩敤virtualbox閲岄潰瀹夎涓涓櫄鎷熺郴缁熺殑鏂瑰紡銆傛瘡娆″畨瑁呬箣鍚庯紝閮藉彂鐜颁笉鑳借闂噷闈㈢殑80銆?1銆?306绛夎繖浜涘父鐢ㄧ殑绔彛銆備篃灏辨槸璇达紝鎴戝彧鑳藉湪鏈満璁块棶杩欎簺绔彛锛屾兂浠庡叾浠栨満鍣ㄨ闂笉OK浜嗐傛兂璧蜂互鍓嶈嚜宸变负浜嗚繖浠朵簨鑺变簡鏁存暣涓鍛ㄧ殑鏃跺欐墠鐭ラ亾鏄鍙g殑闂銆備粖澶╀竴瀹氳璁板綍涓嬫潵锛屽厤寰椾笅娆″張蹇樿浜嗐?/p><p style="margin: 0px 0px 10px; padding: 0px; color: #333333; font-family: 寰蒋闆呴粦, Verdana, Tahoma, 'BitStream vera Sans', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 26px; background-color: #fcfff6; ">寮鍚?0銆?1銆?306绔彛锛?/p><pre prettyprint"="" style="margin-top: 6px; margin-bottom: 6px; padding: 2px 7px; font-family: 'Courier New', Courier, monospace, Fixed; overflow: auto; background-color: #f0f6e9; border: 1px solid #cccccc; font-size: 12.3px; line-height: 16px; width: 645.816650390625px; color: #333333; "><span style="margin: 0px; padding: 0px; color: #008800; ">/sbin/</span><span style="margin: 0px; padding: 0px; color: #000000; ">iptables </span><span style="margin: 0px; padding: 0px; color: #666600; ">-</span><span style="margin: 0px; padding: 0px; color: #000000; ">I INPUT </span><span style="margin: 0px; padding: 0px; color: #666600; ">-</span><span style="margin: 0px; padding: 0px; color: #000000; ">p tcp </span><span style="margin: 0px; padding: 0px; color: #666600; ">--</span><span style="margin: 0px; padding: 0px; color: #000000; ">dport </span><span style="margin: 0px; padding: 0px; color: #006666; ">80</span> <span style="margin: 0px; padding: 0px; color: #666600; ">-</span><span style="margin: 0px; padding: 0px; color: #000000; ">j ACCEPT <br /></span><span style="margin: 0px; padding: 0px; color: #666600; ">/</span><span style="margin: 0px; padding: 0px; color: #000000; ">sbin</span><span style="margin: 0px; padding: 0px; color: #666600; ">/</span><span style="margin: 0px; padding: 0px; color: #000000; ">iptables </span><span style="margin: 0px; padding: 0px; color: #666600; ">-</span><span style="margin: 0px; padding: 0px; color: #000000; ">I INPUT </span><span style="margin: 0px; padding: 0px; color: #666600; ">-</span><span style="margin: 0px; padding: 0px; color: #000000; ">p tcp </span><span style="margin: 0px; padding: 0px; color: #666600; ">--</span><span style="margin: 0px; padding: 0px; color: #000000; ">dport </span><span style="margin: 0px; padding: 0px; color: #006666; ">3306</span> <span style="margin: 0px; padding: 0px; color: #666600; ">-</span><span style="margin: 0px; padding: 0px; color: #000000; ">j ACCEPT <br /></span><span style="margin: 0px; padding: 0px; color: #666600; ">/</span><span style="margin: 0px; padding: 0px; color: #000000; ">sbin</span><span style="margin: 0px; padding: 0px; color: #666600; ">/</span><span style="margin: 0px; padding: 0px; color: #000000; ">iptables </span><span style="margin: 0px; padding: 0px; color: #666600; ">-</span><span style="margin: 0px; padding: 0px; color: #000000; ">I INPUT </span><span style="margin: 0px; padding: 0px; color: #666600; ">-</span><span style="margin: 0px; padding: 0px; color: #000000; ">p tcp </span><span style="margin: 0px; padding: 0px; color: #666600; ">--</span><span style="margin: 0px; padding: 0px; color: #000000; ">dport </span><span style="margin: 0px; padding: 0px; color: #006666; ">21</span> <span style="margin: 0px; padding: 0px; color: #666600; ">-</span><span style="margin: 0px; padding: 0px; color: #000000; ">j ACCEPT <br /></span><span style="margin: 0px; padding: 0px; color: #666600; ">/</span><span style="margin: 0px; padding: 0px; color: #000000; ">etc</span><span style="margin: 0px; padding: 0px; color: #666600; ">/</span><span style="margin: 0px; padding: 0px; color: #000000; ">init</span><span style="margin: 0px; padding: 0px; color: #666600; ">.</span><span style="margin: 0px; padding: 0px; color: #000000; ">d</span><span style="margin: 0px; padding: 0px; color: #666600; ">/</span><span style="margin: 0px; padding: 0px; color: #000000; ">iptables save <br />service iptables restart</span></pre><p style="margin: 0px 0px 10px; padding: 0px; color: #333333; font-family: 寰蒋闆呴粦, Verdana, Tahoma, 'BitStream vera Sans', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 26px; background-color: #fcfff6; ">鍏跺疄锛屽垰鍒氱湅浜嗕互鍓嶅啓杩囩殑涓绡囨枃绔犮傚彂鐜版鏂囧凡缁忔槸澶氫綑鐨勪簡銆傚攭銆傛棦鐒跺啓浜嗐傚氨鍐欏畬鏁翠竴鐐瑰惂銆?/p><p style="margin: 0px 0px 10px; padding: 0px; color: #333333; font-family: 寰蒋闆呴粦, Verdana, Tahoma, 'BitStream vera Sans', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 26px; background-color: #fcfff6; ">涓鑸潵璇达紝鎴戜滑涓嶄細浣跨敤linux鑷甫鐨勯槻鐏鐨勩傚湪IDC鏈烘埧锛屼汉瀹剁殑闃茬伀澧欐槸纭欢銆傝偗瀹氭瘮杞欢瑕佸己澶у緱澶氥?/p><p style="margin: 0px 0px 10px; padding: 0px; color: #333333; font-family: 寰蒋闆呴粦, Verdana, Tahoma, 'BitStream vera Sans', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 26px; background-color: #fcfff6; ">鍙互浣跨敤濡備笅鏂瑰紡瀵规搷浣滈槻鐏锛?br style="margin: 0px; padding: 0px; " />姘镐箙鎬у叧鎺夐槻鐏shell锛?/p><pre prettyprint"="" style="margin-top: 6px; margin-bottom: 6px; padding: 2px 7px; font-family: 'Courier New', Courier, monospace, Fixed; overflow: auto; background-color: #f0f6e9; border: 1px solid #cccccc; font-size: 12.3px; line-height: 16px; width: 645.816650390625px; color: #333333; "><span style="margin: 0px; padding: 0px; color: #000000; ">chkconfig </span><span style="margin: 0px; padding: 0px; color: #666600; ">--</span><span style="margin: 0px; padding: 0px; color: #000000; ">level </span><span style="margin: 0px; padding: 0px; color: #006666; ">35</span><span style="margin: 0px; padding: 0px; color: #000000; "> iptables off</span></pre><p style="margin: 0px 0px 10px; padding: 0px; color: #333333; font-family: 寰蒋闆呴粦, Verdana, Tahoma, 'BitStream vera Sans', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 26px; background-color: #fcfff6; ">閫氳繃濡備笅鍛戒护鏌ョ湅闃茬伀澧欐槸鍚﹀叧闂細</p><pre prettyprint"="" style="margin-top: 6px; margin-bottom: 6px; padding: 2px 7px; font-family: 'Courier New', Courier, monospace, Fixed; overflow: auto; background-color: #f0f6e9; border: 1px solid #cccccc; font-size: 12.3px; line-height: 16px; width: 645.816650390625px; color: #333333; "><span style="margin: 0px; padding: 0px; color: #000000; ">service iptables status</span></pre><p style="margin: 0px 0px 10px; padding: 0px; color: #333333; font-family: 寰蒋闆呴粦, Verdana, Tahoma, 'BitStream vera Sans', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 26px; background-color: #fcfff6; ">濡傛灉宸茬粡姝g‘鍏抽棴锛屽垯浼氳緭鍑哄涓嬩俊鎭細</p><pre prettyprint"="" style="margin-top: 6px; margin-bottom: 6px; padding: 2px 7px; font-family: 'Courier New', Courier, monospace, Fixed; overflow: auto; background-color: #f0f6e9; border: 1px solid #cccccc; font-size: 12.3px; line-height: 16px; width: 645.816650390625px; color: #333333; "><span style="margin: 0px; padding: 0px; color: #000000; ">iptables</span><span style="margin: 0px; padding: 0px; color: #666600; ">锛氭湭杩愯闃茬伀澧欍?/span></pre><p style="margin: 0px 0px 10px; padding: 0px; color: #333333; font-family: 寰蒋闆呴粦, Verdana, Tahoma, 'BitStream vera Sans', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 26px; background-color: #fcfff6; ">濡傛灉锛屼綘鐨勬槸鑻辨枃鐗堟湰锛屽垯鍙兘鎻愮ず淇℃伅涓嶅お涓鏍枫?br style="margin: 0px; padding: 0px; " />濡傛灉娌℃湁杈撳嚭绫讳技闃茬伀澧欏叧闂殑淇℃伅锛岀洿鎺ラ噸鍚郴缁熸垨鑰呮墽琛屽涓嬪懡浠よ瘯涓璇曪細</p><pre prettyprint"="" style="margin-top: 6px; margin-bottom: 6px; padding: 2px 7px; font-family: 'Courier New', Courier, monospace, Fixed; overflow: auto; background-color: #f0f6e9; border: 1px solid #cccccc; font-size: 12.3px; line-height: 16px; width: 645.816650390625px; color: #333333; "><span style="margin: 0px; padding: 0px; color: #000000; ">service iptables stop</span></pre><p style="margin: 0px 0px 10px; padding: 0px; color: #333333; font-family: 寰蒋闆呴粦, Verdana, Tahoma, 'BitStream vera Sans', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 26px; background-color: #fcfff6; ">鍏虫帀闃茬伀澧欎箣鍚庯紝閭d箞鎵鏈夊紑鍚殑绔彛閮藉皢浼氭毚闇茬粰浜掕仈缃戞墍鏈変汉銆傞偅涔堬紝鍙兘浼氬鑷村埆鏈夌敤蹇冪殑浜洪拡瀵逛綘鐨勭郴缁熸紡娲炲仛鍑轰竴浜涚牬鍧忕殑浜嬫儏銆?/p><p style="margin: 0px 0px 10px; padding: 0px; color: #333333; font-family: 寰蒋闆呴粦, Verdana, Tahoma, 'BitStream vera Sans', Arial, Helvetica, sans-serif; font-size: 13px; line-height: 26px; background-color: #fcfff6; ">闄や簡杩欎釜杩樻湁涓涓笢瑗挎槸灏盨ELINUX杩欎釜鐜╂剰鍎裤傚鏋滈槻鐏鏀惧紑浜嗙鍙d篃鏃犳硶杩涜璁块棶銆傝鏄庤繖涓帺鎰忓仛浜嗛檺鍒讹紝澶у灏嗗畠鍏抽棴鍗冲彲銆?/p><img src ="//www.cqk4s.cn/gembin/aggbug/393378.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="//www.cqk4s.cn/gembin/" target="_blank">gembin</a> 2012-12-23 22:40 <a href="//www.cqk4s.cn/gembin/archive/2012/12/23/393378.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>VirtualBox 瀹夎 CentOs 6.3 - ▼幸运赛车规则▼幸运赛车投注▼幸运赛车开奖结果查询▼湖南幸运赛车开奖奖金▼幸运赛车走势▼//www.cqk4s.cn/gembin/archive/2012/12/23/393376.htmlgembingembinSun, 23 Dec 2012 14:15:00 GMT//www.cqk4s.cn/gembin/archive/2012/12/23/393376.html//www.cqk4s.cn/gembin/comments/393376.html//www.cqk4s.cn/gembin/archive/2012/12/23/393376.html#Feedback0//www.cqk4s.cn/gembin/comments/commentRss/393376.html//www.cqk4s.cn/gembin/services/trackbacks/393376.html涓銆佺幆澧冨強璧勬簮鍑嗗锛?br style="margin: 0px; padding: 0px; " />1锛夎櫄鎷熸満VritualBox 4.2鐗堟湰銆傜櫨搴︽悳绱笅杞芥杞欢寰堝鏄撲笅杞斤紝鎴戜竴鑸槸鍘诲ぉ绌鸿蒋浠跺拰鍗庡啗杞欢缃戠珯鍘讳笅杞姐?br style="margin: 0px; padding: 0px; " />2锛塁entOs鐗堟湰閲囩敤鐨勬槸CentOS-6.3-x86_64-minimal.iso锛屽嵆鏈灏忓寲瀹夎鐨勭増鏈傛渶灏忓寲瀹夎鐗堟湰娌℃湁鍥惧舰鐣岄潰锛岃繖鏍锋秷鑰桟PU鍜屽唴瀛樼殑澶уぇ鍑忓皯锛屾墍浠ワ紝甯稿父鐢ㄦ潵瀹夎鏈嶅姟鍣ㄧ郴缁熶娇鐢ㄣ傝屾闈㈢増鏈涔犱娇鐢ㄥ眳澶氥傝屾垜浠殑鐩殑灏辨槸瑕佷互鏈嶅姟鍣ㄩ厤缃负鐩爣杩涜銆?br style="margin: 0px; padding: 0px; " />CentOS 6.3 64浣嶄笅杞藉湴鍧锛?a title="//mirror.bit.edu.cn/centos/6.3/isos/x86_64/CentOS-6.3-x86_64-minimal.iso" target="_blank" style="margin: 0px; padding: 0px; text-decoration: none; color: #0b75b6; ">//mirror.bit.edu.cn/centos/6.3/isos/x86_64/CentOS-6.3-x86_64-minimal.iso
3锛夋垜鐨勭郴缁熸槸Win7 64浣嶇殑銆?windows xp 鍜寃indows 7 32浣嶅潎鍙?/p>

浜屻佸畨瑁呴厤缃櫄鎷熸満绯荤粺
1锛?鎵撹櫄鎷熸満銆傜劧鍚庯紝閫夋嫨铏氭嫙鏈哄伐鍏锋爮涓婄殑“鏂板缓”鎸夐挳銆傚鍥撅細

 

 

 

 

 

 

 

 

 

 

 

 

2锛夌偣鍑?#8220;鏂板缓”鎸夐挳鍚庯紝寮瑰嚭濡備笅寮瑰嚭妗嗭紝鎴戜滑鍦ㄥ悕绉伴」閲岄潰杈撳叆锛歝entos 6.3 mini銆傝繖涓綅缃殢渚垮~鍐欐病鏈変换浣曢棶棰樸傚鏋滐紝浣犲~鍐欑殑鏄痺indows xp鐨勮瘽锛屽垯绫诲瀷浼氳嚜鍔ㄥ彉鎴恮indows锛岀増鏈嚜鍔ㄤ細鍙樻垚windows xp銆傚綋鎴戜滑濉啓centos 6.3鐨勬椂鍊欙紝绫诲瀷浼氳嚜鍔ㄥ彉鎴怢inux锛岀増鏈細鍙樻垚 Red Hat銆備絾鏄紝鎴戜滑瀹夎鐨勬槸64浣嶇殑锛屾墍浠ワ紝瑕佷慨鏀筊ed Hat (64 bit)銆?br style="margin: 0px; padding: 0px; " />

3锛夌偣鍑?#8220;涓嬩竴姝?#8221;锛屽脊鍑哄唴瀛樺垎閰嶇殑閫夐」妗嗐傝繖涓湴鏂圭壒鍒娉ㄦ剰锛屽唴瀛樺湪768MB杩欎釜浣嶇疆鏄竴涓垎姘村箔銆傚鏋滀綆浜庤繖涓繖涓硷紝鍒欏畨瑁呯殑鏃跺欎細杩涘叆瀛楃瀹夎妯″紡銆傚ぇ浜庣瓑浜庤繖涓间細杩涘叆鍥惧舰瀹夎鐣岄潰銆傚垰寮濮嬫垜涓嶅お鐔熸倝瀛楃瀹夎妯″紡锛屼竴鐩村湪杩欓噷绾犵粨浜嗗緢涔呴兘涓嶇煡閬撲负浠涔堛傚悗闈紝鐧惧害鎼滅储绛旀鐨勬椂鍊欙紝鍙戠幇瀹樻柟宸茬粡鏈夎鏄庛傚鍥撅紝鎴戝垎閰嶄簡1024MB鐨勫唴瀛樸傚浘涓殑缁胯壊鐨勭嚎浠h〃鏄唴瀛樻渶浣崇殑鍒嗛厤鍊硷紝瓒呰繃杩欎釜鍊硷紝鍙兘浼氶犳垚绯荤粺鍐呭瓨涓嶈冻鐨勯棶棰樸?br style="margin: 0px; padding: 0px; " />

4锛夌偣鍑?#8220;涓嬩竴姝?#8221;淇濇寔榛樿鐨勯夐」涓嶅彉锛屽鍥撅細

5锛夌偣鍑?#8220;鍒涘缓”锛屽脊鍑洪夐」妗嗭紝淇濇寔榛樿涓嶅彉銆傚鍥撅細

6锛夌偣鍑?#8220;涓嬩竴姝?#8221;锛屽脊鍑鸿櫄鎷熺‖鐩樼┖闂村垎閰嶇殑鏂瑰紡銆備竴鑸繚鎸侀粯璁や笉鍙樸傚鍥撅細

7锛夌偣鍑?#8220;涓嬩竴姝?#8221;锛岃缃櫄鎷熺‖鐩樹綅缃拰澶у皬銆傛垜灏嗚櫄鎷熺‖鐩樻枃浠剁殑浣嶇疆鏀剧疆鍦ㄤ簡G:\VBoxs涓紝澶у皬閰嶇疆20GB銆傚鍥撅細

8锛夌偣鍑?#8220;鍒涘缓”鎸夐挳锛屽嵆瀹屾垚浜嗗铏氭嫙鏈虹殑鍒涘缓銆備絾鏄紝姝ゆ椂鍙槸鎶婇厤缃仛濂戒簡銆傚嵆涓嬫潵鐨勬搷浣滄墠鏄畨瑁呯郴缁熴傛鏃讹紝鍦╒Box鍒楄〃閲岄潰宸茬粡鏈変簡鍒氭墠鍒涘缓鐨勮櫄鎷熸満銆傚鍥撅細

9锛夊埌姝や竴姝ワ紝鎴戜滑鐨勯厤缃苟娌℃湁缁撴潫銆傚洜涓猴紝寰堝鏈哄櫒鐜板湪鐨勫唴瀛橀兘宸茬粡4GB浜嗐傝繖浼氱粰32浣嶇殑绯荤粺瀹夎閫犳垚涓浜涢棶棰樸傛墍浠ワ紝鎴戜滑杩橀渶瑕佹潵娑堥櫎杩欎簺闂銆傚彸閿変腑锛孷Box鍒楄〃涓垰鎵嶅垱寤虹殑铏氭嫙鏈猴紝閫夋嫨“璁剧疆”锛岄夋嫨“绯荤粺”锛屽啀閫夋嫨“澶勭悊鍣?P)”锛屼細鐪嬪埌涓椤癸細鎵╁睍鐗规с傛垜浠妸瀹冨嬀閫変笂锛岃铏氭嫙鏈烘敮鎸?GB浠ヤ笂鐨勫唴瀛樸傚鍥撅細

10锛夌幇鍦ㄦ垜浠鎶奀entos ISO闀滃儚鏂囦欢鍔犺浇鍒拌櫄鎷熸満涓傚湪涓婂浘涓殑宸︿晶涓夋嫨“鍌ㄥ瓨”銆傜劧鍚庢牴鎹笅鍥句腑鐨勬搷浣滆繘琛岋細

11锛夎櫄鎷熸満闄や簡闀滃儚杩樺彲浠ヤ娇鐢ㄧ數鑴戠殑鍏夐┍杩涜瀹夎銆傚鍥撅細

鐒跺悗鐐瑰嚮“纭畾”鍗冲彲銆?/p>

12锛夋鏃讹紝鎴戜滑鍐嶇偣鍑籚Box宸ュ叿鏍蜂笂鐨?#8220;鍚姩”鎸夐挳銆傜偣鍑讳箣鍓嶏紝蹇呴』鍏堥変腑鍒氭墠鎴戜滑鍒涘缓鐨勮櫄鎷熸満銆傚氨浼氬埌杈惧涓嬬晫闈細

濡傛灉锛屼綘杩涘叆杩欎釜鐣岄潰涔嬪墠锛屽脊鍑哄涓嬮敊璇彁绀猴細
VT-x/AMD-V 纭欢鍔犻熷櫒宸茶鍚姩锛屼絾褰撳墠澶勪簬鏃犳晥鐘舵併傛偍铏氭嫙鐢佃剳鍐呯殑鎿嶄綔绯荤粺灏嗘棤娉曟娴嬪埌64浣嶇殑CPU锛屽洜姝や篃灏嗘棤娉曞惎鍔?#8230;.

閭d箞锛屼綘瑕佺‘瀹氫綘鐨凜PU鏄敮鎸?4浣嶇殑锛屽彲浠ユ寜鐓у涓嬫柟寮忚繘琛岃В鍐筹細
1銆佽纭浣犵殑iso鏂囦欢鎴朌VD涓?4浣嶇殑IOS鏂囦欢銆?br style="margin: 0px; padding: 0px; " />2銆佽纭浣犵殑CPU涓?4浣嶇殑CPU銆?br style="margin: 0px; padding: 0px; " />3銆佽纭BIOS鐨刅irtualization鏄惁涓篍nabled銆傝缃柟娉曪細杩涘叆BIOS—->Advanced BIOS Features—–>Virtualization—->Disabled(棰勮鍊?淇敼涓篍nabled锛屽偍瀛?save)锛岄噸鍚傛湁浜汢IOS璁剧疆鏂规硶涓庢骞朵笉鐩稿悓锛屾瘮濡傦紝鏈変簺绗旇鏈琕irualization杩欎釜閫夐」杩涘幓鏄皢VT-x涓嶢MD-v涓ら」璁剧疆鍒嗗紑鐨勩傛墍浠ワ紝瑕佸皢涓や釜閫夐」閮借璁剧疆涓篍nabled銆?/p>

13锛夋垜浠夋嫨”Install or upgrade an existsing system”锛岀劧鍚庯紝鏁插嚮鍥炶溅閿線涓嬪畨瑁呫?/p>

14锛夋帴涓嬫潵浼氱殑鐣岄潰鏄浣犳娴嬭瀹夎鐨勭郴缁熶粙璐ㄦ槸鍚﹀畬鏁存湁鏁堛傚洜涓烘垜鏄粠姝h娓犻亾涓嬭浇鐨勭郴缁烮SO锛屾墍浠ワ紝鍩烘湰涓婁笉浼氬嚭鐜伴棶棰樸傛墍浠ワ紝鎴戦夋嫨浜?#8220;Skip”閫夐」璺宠繃浠嬭川妫娴嬨傚鍥撅細

 

15锛夊洖杞?#8220;Skip”涔嬪悗鍑虹幇濡備笅鐣岄潰锛岄夋嫨鐐瑰嚮“Next”銆?/p>

16锛夋鏃朵細鍑虹幇涓涓夋嫨褰撳墠绯荤粺璇█鐨勯夐」锛屾垜浠偗瀹氭槸閫夋嫨绠浣撲腑鏂囦簡锛岄夋嫨涔嬪悗鐐瑰嚮涓嬩竴姝ャ傚鍥撅細

17锛夋鏃朵細鍑虹幇涓涓敭鐩樿瑷鐨勯夋嫨锛屾垜浠偗瀹氭槸閫夋嫨“缇庡浗寮忚嫳璇?#8221;浜嗐備篃灏辨槸淇濇寔榛樿閫夐」锛岀偣鍑?#8220;涓嬩竴姝?#8221;鍗冲彲銆傚鍥撅細

18锛夊嚭鐜板涓嬬晫闈紝淇濇寔榛樿鍗冲彲锛岀劧鍚庣偣鍑?#8220;涓嬩竴姝?#8221;缁х画寰涓嬪畨瑁呫傚鍥撅細

19锛夊嚭鐜板涓嬬晫闈紝鐐瑰嚮“鏄紝蹇界暐鎵鏈夋暟鎹?#8221;銆傚洜涓猴紝鍦╒irtualBox閲岄潰锛屾墍鍋氱殑浠讳綍鎿嶄綔閮戒笉浼氬奖鍝嶅埌鐪熷疄绯荤粺閲岄潰鐨勬暟鎹傛墍浠ワ紝鏀惧績澶ц儐鍦伴夋嫨姝ら」鍚с傚鍥撅細

20锛夌劧鍚庡嚭鐜板涓嬬晫闈紝瑕佹眰鎴戜滑涓鸿繖鍙拌绠楁満鍙栦竴涓悕瀛椼傚緢绠鍗曪紝鎴戜滑鎸夌収瑕佹眰濉啓鍗冲彲銆傚鍥撅細

21锛夋帴涓嬫潵鐨勭晫闈㈡槸璁╂垜浠负鐢佃剳璁剧疆涓涓椂鍖恒傛垜鐨勯夋嫨濡傚浘鎵绀猴細

22锛夊嵆涓嬫潵锛屼細瑕佹眰鎴戜滑涓洪粯璁ょ殑root绯荤粺璐︽埛璁剧疆涓涓瘑鐮併傚鍥撅細

濡傛灉锛屼綘璁剧疆鐨勫瘑鐮佽繃浜庣畝鍗曘傚锛?23456杩欐牱鐨勫瘑鐮侊紝鍒欑郴缁熶細鎻愮ず鎴戜滑锛屽瘑鐮佸己搴︿笉澶熷畨鍏ㄣ傛垜浠笉绠″畠锛岀洿鎺ラ夋嫨“鏃犺濡備綍閮戒娇鐢?U)” 鍗冲彲銆傚鍥撅細

23锛夊湪鎺ヤ笅鏉ョ殑鐣岄潰涓紝鎴戜滑閫夋嫨“浣跨敤鎵鏈夌┖闂?#8221;鐨勯夐」杩涜瀹夎銆傚鏋滐紝浣犳兂鍦ㄧ數鑴戜笂瑁呭弻绯荤粺锛岄偅涔堣涓嶈閫夋嫨姝ら」銆傛垜浠槸鐢╒ittualBox瀹屽叏涓嶇敤鎷呭績纭洏浼氳鏍煎紡鍖栫殑闂銆傚鍥撅細

24锛夌偣鍑?#8220;涓嬩竴姝?#8221;浼氬脊鍑哄涓嬫彁绀烘锛屾垜浠夋嫨“灏嗕慨鏀瑰啓鍏ョ‖鐩?#8221;閫夋嫨銆?/p>

25锛塐K銆備竴鍒囧畬姣曚箣鍚庯紝灏辫鎵ц瀹夎杩囩▼浜嗐傛垜浠兘鍋氱殑灏辨槸绛夊緟銆傚綋瀹夎杩涘害100%鐨勬椂鍊欙紝浼氭彁绀烘垜浠噸鏂板紩瀵肩郴缁熴傚埌鏃跺欒寰楃偣鍑诲嵆鍙傚鍥撅細

 
鍙夌殑绫诲瀷璇存槑濡備笅锛?nbsp;
Desktop 銆锛氬熀鏈殑妗岄潰绯荤粺锛屽寘鎷父鐢ㄧ殑妗岄潰杞欢锛屽鏂囨。鏌ョ湅宸ュ叿銆?/span>
Minimal Desktop銆锛氬熀鏈殑妗岄潰绯荤粺锛屽寘鍚殑杞欢鏇村皯銆?/span>
Minimal锛氬熀鏈殑绯荤粺锛屼笉鍚湁浠讳綍鍙夌殑杞欢鍖呫?/span>
Basic Server 銆锛氬畨瑁呯殑鍩烘湰绯荤粺鐨勫钩鍙版敮鎸侊紝涓嶅寘鍚闈€?/span>
Database Server銆锛氬熀鏈郴缁熷钩鍙帮紝鍔犱笂MySQL鍜孭ostgreSQL鏁版嵁搴擄紝鏃犳闈€?/span>
Web Server銆锛?/strong>鍩烘湰绯荤粺骞冲彴锛屽姞涓奝HP锛學eb server锛岃繕鏈塎ySQL鍜孭ostgreSQL鏁版嵁搴撶殑瀹㈡埛绔紝鏃犳闈€?/span>
Virtual Host锛氬熀鏈郴缁熷姞铏氭嫙骞冲彴銆?/span>
Software Development Workstation銆锛氬寘鍚蒋浠跺寘杈冨锛屽熀鏈郴缁燂紝铏氭嫙鍖栧钩鍙帮紝妗岄潰鐜锛屽紑鍙戝伐鍏枫?/span>

鍒版鍏充簬VirtualBox瀹夎Centos 6.3 鏈灏忓寲瀹夎宸茬粡浠嬬粛瀹屼簡銆?/p>

gembin 2012-12-23 22:15 鍙戣〃璇勮
]]>
CentOS-璇█璁剧疆 - ▼幸运赛车规则▼幸运赛车投注▼幸运赛车开奖结果查询▼湖南幸运赛车开奖奖金▼幸运赛车走势▼//www.cqk4s.cn/gembin/archive/2012/12/23/393375.htmlgembingembinSun, 23 Dec 2012 14:08:00 GMT//www.cqk4s.cn/gembin/archive/2012/12/23/393375.html//www.cqk4s.cn/gembin/comments/393375.html//www.cqk4s.cn/gembin/archive/2012/12/23/393375.html#Feedback0//www.cqk4s.cn/gembin/comments/commentRss/393375.html//www.cqk4s.cn/gembin/services/trackbacks/393375.html鏌ョ湅鎵鏈夌殑locale璇█

  1. # locale -a 
  2. # locale -a|grep en 

■ 鏌ョ湅褰撳墠鎿嶄綔绯荤粺浣跨敤鐨勮瑷

  1. # echo $LANG 

■ 璁剧疆绯荤粺locale璇█涓轰腑鏂囩幆澧冿紙姘镐箙鐢熸晥锛?/p>

# vi /etc/sysconfig/i18n

  1. LANG="zh_CN.UTF-8" 

■ 璁剧疆绯荤粺locale璇█涓鸿嫳鏂囩幆澧冿紙姘镐箙鐢熸晥锛?/p>

  1. LANG="en_US.UTF-8" 

■ 涓存椂鏀瑰彉绯荤粺locale璇█锛堥鍑烘湰娆$櫥褰曠珛鍗冲け鏁堬級

  1. # export LANG=zh_CN.UTF-8 

■ 瀹夎涓枃瀛椾綋

  1. # yum install fonts-chinese.noarch 

■ 鎸囧畾涓枃瀛椾綋璺緞

# vi /etc/X11/fs/config

  1. catalogue = /usr/X11R6/lib/X11/fonts/misc:unscaled, 
  2.         /usr/X11R6/lib/X11/fonts/75dpi:unscaled, 
  3.         /usr/X11R6/lib/X11/fonts/100dpi:unscaled, 
  4.         /usr/X11R6/lib/X11/fonts/Type1, 
  5.         /usr/share/fonts/default/Type1, 
  6.         , 
  7.         /usr/share/fonts/zh_CN/TrueType, 
  8.         /usr/share/fonts/zh_TW/TrueType 



    鏂规硶2

    淇敼CentOS杩愯鐜鐨勯粯璁よ瑷鐜鍙橀噺鍊?/p>

    [root@www ~]# vi /etc/profile

    鎵惧埌export璇彞锛屽湪璇彞鍓嶉潰鍔犲叆

    LANG=”en_US.UTF-8″

    鍐嶅湪export鍚庨潰杩藉姞LANG

    export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC LANG

    淇濆瓨閰嶇疆锛屼慨鏀笴entOS璇█瀹屾垚銆?/p>



gembin 2012-12-23 22:08 鍙戣〃璇勮
]]>
MySQL on Mac OS X - ▼幸运赛车规则▼幸运赛车投注▼幸运赛车开奖结果查询▼湖南幸运赛车开奖奖金▼幸运赛车走势▼//www.cqk4s.cn/gembin/archive/2012/09/22/388351.htmlgembingembinSat, 22 Sep 2012 15:38:00 GMT//www.cqk4s.cn/gembin/archive/2012/09/22/388351.html//www.cqk4s.cn/gembin/comments/388351.html//www.cqk4s.cn/gembin/archive/2012/09/22/388351.html#Feedback0//www.cqk4s.cn/gembin/comments/commentRss/388351.html//www.cqk4s.cn/gembin/services/trackbacks/388351.htmlIf you have installed the Startup Item, use this command:

shell> sudo /Library/StartupItems/MySQLCOM/MySQLCOM start 
(Enter your password, if necessary)
(Press Control-D or enter "exit" to exit the shell)

If you do not use the Startup Item, enter the following command sequence:

shell> cd /usr/local/mysql 
shell> sudo ./bin/mysqld_safe
(Enter your password, if necessary)
(Press Control-Z)
shell> bg
(Press Control-D or enter "exit" to exit the shell)

You should be able to connect to the MySQL server, for example, by running /usr/local/mysql/bin/mysql.
alias mysql=/usr/local/mysql/bin/mysql
alias mysqladmin=/usr/local/mysql/bin/mysqladmin


Sequel Pro is a database management app for MySQL databases
//www.sequelpro.com/


gembin 2012-09-22 23:38 鍙戣〃璇勮
]]>
ethtool and mii-tool - ▼幸运赛车规则▼幸运赛车投注▼幸运赛车开奖结果查询▼湖南幸运赛车开奖奖金▼幸运赛车走势▼//www.cqk4s.cn/gembin/archive/2012/09/07/387249.htmlgembingembinFri, 07 Sep 2012 06:41:00 GMT//www.cqk4s.cn/gembin/archive/2012/09/07/387249.html//www.cqk4s.cn/gembin/comments/387249.html//www.cqk4s.cn/gembin/archive/2012/09/07/387249.html#Feedback0//www.cqk4s.cn/gembin/comments/commentRss/387249.html//www.cqk4s.cn/gembin/services/trackbacks/387249.htmlmii-tool锛堣繖鏄疞inux涓嬩笓闂ㄨ缃綉鍗″伐浣滄ā寮忕殑鍛戒护锛?/span>
銆銆1. 鏌ョ湅缃戝崱鐨勫伐浣滄ā寮忥紝杈撳叆鍛戒护锛?/span>
銆銆#mii-tool -v
銆銆eth0: negotiated 100baseTx-FD, link ok
銆銆product info: vendor 00:aa:00, model 56 rev 0
銆銆basic mode: autonegotiation enabled
銆銆basic status: autonegotiation complete, link ok
銆銆capabilities: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD
銆銆advertising: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control
銆銆link partner: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD
銆銆浠庝互涓婁俊鎭腑鍙互鐪嬪嚭锛岃繖鍧楃綉鍗″伐浣滃湪100M鍏ㄥ弻宸ヨ嚜閫傚簲妯″紡涓嬶紝“100BaseTx-FD”鎰忎负100M Full Duplex銆?/span>
銆銆2. 鏇存敼缃戝崱鐨勫伐浣滄ā寮忥紝杈撳叆鍛戒护锛?/span>
銆銆#mii-tool -F media [interface]
銆銆media鍙夌殑妯″紡鏈?00baseTx-FD銆?00baseTx-HD銆?0baseT-FD銆?0baseT-HD绛夈?Interface浠h〃鎵閫夋嫨鐨勭綉鍗★紝濡俥th0銆乪th1绛夛紝榛樿涓篹th0銆?/span>
銆銆渚嬪锛岃缃綉鍗″伐浣滃湪10M鍗婂弻宸ユā寮忎笅锛岃緭鍏ュ懡浠わ細
銆銆#mii-tool -F 10baseT-HD eth0
銆銆3. 鎭㈠缃戝崱鐨勮嚜閫傚簲宸ヤ綔妯″紡锛岃緭鍏ュ懡浠わ細
銆銆#mii-tool -r eth0
銆銆鏇磋缁嗙殑浣跨敤鏂规硶鍙互鐢╩ii-tool -h鏉ヨ幏寰椼?br />


ethtool/mii-tool

PrintPDF

Linux LAN card: Find out full duplex / half speed or mode

Q. How do I find out if my Lan (NIC) card working at full or halt duplex mode / speed under Linux?

A. LAN card or NIC is use to send and receive data. Technically, we use word Duplex for this functionality. Full duplex means you are able to send and receive data (files) simultaneously. In half duplex, you can either send or receive data at a time (i.e. you cannot send receive data (files) simultaneously). Obviously, full duplex gives you best user experience. However, how can I find out whether I am using full duplex/half duplex speed/mode?
Task: Find full or half duplex speed

You can use dmesg command to find out your duplex mode:

# dmesg | grep -i duplex

Output:

eth0: link up, 100Mbps, full-duplex, lpa 0x45E1

ethtool command

Uss ethtool to display or change ethernet card settings. To display duplex speed, enter:

# ethtool eth1

Output:

Settings for eth1:
Supported ports: [ TP ]
Supported link modes:   10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Supports auto-negotiation: Yes
Advertised link modes:  10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Full
Advertised auto-negotiation: Yes
Speed: 10Mb/s
Duplex: Full
Port: Twisted Pair
PHYAD: 0
Transceiver: internal
Auto-negotiation: on
Supports Wake-on: umbg
Wake-on: g
Current message level: 0x00000007 (7)
Link detected: yes

mii-tool command

You can also use mii-tool to find out your duplex mode. Type following command at shell prompt:

# mii-tool


Output:

eth0: negotiated 100baseTx-FD flow-control, link ok

Remember,


1. 100baseTx-FD: 100Mbps full duplex (FD)
2. 100baseTx-HD: 100Mbps half duplex (HD)
3. 10baseT-FD: 10Mbps full duplex (FD)
4. 10baseT-HD: 10Mbps half duplex (HD)

mii-tool utility checks or sets the status of a network interface Media Independent Interface (MII) unit. Most fast ethernet adapters use an MII to autonegotiate link speed and duplex setting. If you are using old card then this utility may not work (use dmesg command).

This utility is useful for forcing specific Ethernet speed and duplex settings too, setup 100Mbps full duplex speed under Linux:

# mii-tool -F 100baseTx-FD


Setup 10Mbps half duplex:

# mii-tool -F 10baseT-HD


source:

//www.cyberciti.biz/faq/howto-setup-linux-lan-card-find-out-full-duplex-half-speed-or-mode/



gembin 2012-09-07 14:41 鍙戣〃璇勮
]]>
XML Naming Conventions - ▼幸运赛车规则▼幸运赛车投注▼幸运赛车开奖结果查询▼湖南幸运赛车开奖奖金▼幸运赛车走势▼//www.cqk4s.cn/gembin/archive/2012/08/25/386269.htmlgembingembinSat, 25 Aug 2012 08:43:00 GMT//www.cqk4s.cn/gembin/archive/2012/08/25/386269.html//www.cqk4s.cn/gembin/comments/386269.html//www.cqk4s.cn/gembin/archive/2012/08/25/386269.html#Feedback0//www.cqk4s.cn/gembin/comments/commentRss/386269.html//www.cqk4s.cn/gembin/services/trackbacks/386269.htmlNames can start with dash (-) character.
Names cannot start with numbers or other punctuation characters. 
After the first character, numbers, hyphens, and periods are allowed. 
Names can't contain spaces. 
Names can't contain the colon (:) character. 
Names can't start with the letters xml, in uppercase, lowercase, or mixed.
There can't be a space after the opening <
There can be space before the closing > character. 

Here are some examples of valid names: <first.name> 

Following are some examples of invalid names: 

<xml-element> which starts with xml, 

<123> which starts with a number, 

<your=xml> because the equals sign (=)sign is illegal, and 

<your element> which contains a space.


Case Sensitivity
Most XML standards originating from the W3C tend to use lower case with hyphens.
<first> is different from <FIRST>, which is different from <First>. 

It's a good idea to pick a naming style and stick to it. 
Some examples of common styles are as follows: 

<first_name> 
<firstName> 
<first-name> 
<FirstName>



gembin 2012-08-25 16:43 鍙戣〃璇勮
]]>
ANSI sequence parser (Node.js) and client-side renderer - ▼幸运赛车规则▼幸运赛车投注▼幸运赛车开奖结果查询▼湖南幸运赛车开奖奖金▼幸运赛车走势▼//www.cqk4s.cn/gembin/archive/2012/07/21/383681.htmlgembingembinSat, 21 Jul 2012 15:16:00 GMT//www.cqk4s.cn/gembin/archive/2012/07/21/383681.html//www.cqk4s.cn/gembin/comments/383681.html//www.cqk4s.cn/gembin/archive/2012/07/21/383681.html#Feedback0//www.cqk4s.cn/gembin/comments/commentRss/383681.html//www.cqk4s.cn/gembin/services/trackbacks/383681.html

gembin 2012-07-21 23:16 鍙戣〃璇勮
]]>
Flash 3d Sokoban Prototype With Alternativa3d - ▼幸运赛车规则▼幸运赛车投注▼幸运赛车开奖结果查询▼湖南幸运赛车开奖奖金▼幸运赛车走势▼//www.cqk4s.cn/gembin/archive/2012/07/21/383679.htmlgembingembinSat, 21 Jul 2012 15:03:00 GMT//www.cqk4s.cn/gembin/archive/2012/07/21/383679.html//www.cqk4s.cn/gembin/comments/383679.html//www.cqk4s.cn/gembin/archive/2012/07/21/383679.html#Feedback0//www.cqk4s.cn/gembin/comments/commentRss/383679.html//www.cqk4s.cn/gembin/services/trackbacks/383679.html闃呰鍏ㄦ枃

gembin 2012-07-21 23:03 鍙戣〃璇勮
]]>
Flash 3d Sokoban Prototype With Alternativa3d Textured Version - ▼幸运赛车规则▼幸运赛车投注▼幸运赛车开奖结果查询▼湖南幸运赛车开奖奖金▼幸运赛车走势▼//www.cqk4s.cn/gembin/archive/2012/07/21/383678.htmlgembingembinSat, 21 Jul 2012 15:00:00 GMT//www.cqk4s.cn/gembin/archive/2012/07/21/383678.html//www.cqk4s.cn/gembin/comments/383678.html//www.cqk4s.cn/gembin/archive/2012/07/21/383678.html#Feedback0//www.cqk4s.cn/gembin/comments/commentRss/383678.html//www.cqk4s.cn/gembin/services/trackbacks/383678.html闃呰鍏ㄦ枃

gembin 2012-07-21 23:00 鍙戣〃璇勮
]]>
Flash 3d Sokoban Prototype With Alternativa3d Textured Version - ▼幸运赛车规则▼幸运赛车投注▼幸运赛车开奖结果查询▼湖南幸运赛车开奖奖金▼幸运赛车走势▼//www.cqk4s.cn/gembin/archive/2012/07/21/383677.htmlgembingembinSat, 21 Jul 2012 14:58:00 GMT//www.cqk4s.cn/gembin/archive/2012/07/21/383677.html//www.cqk4s.cn/gembin/comments/383677.html//www.cqk4s.cn/gembin/archive/2012/07/21/383677.html#Feedback0//www.cqk4s.cn/gembin/comments/commentRss/383677.html//www.cqk4s.cn/gembin/services/trackbacks/383677.htmlEmanuele Feronato added textures and some environment to Sokoban game prototype made with Flare3D.

I reproduced this prototype on Alternativa3D engine. And here you can find it:

Generally this port is bit different from Emanuele’s version. I can’t find information about feature like SkyBox in Alternativa3D, so this feature coded manually. Another difference is camera behavior. Emanuele binds camera to object and during rotations player object stand still and only camera fly around by its orbit. In Alternativa3d version object rotates too, this allow us to face player object it to it’s current direction. Camera is not binded to the object directly it is binded to object container and we can manipulate with player object in container, add animations, rotations etc. But both variants are good I think.


Here is source code:

package  { 	import alternativa.Alternativa3D; 	import alternativa.engine3d.containers.*; 	import alternativa.engine3d.controllers.*; 	import alternativa.engine3d.core.Camera3D; 	import alternativa.engine3d.core.Clipping; 	import alternativa.engine3d.core.Debug; 	import alternativa.engine3d.core.MipMapping; 	import alternativa.engine3d.core.MouseEvent3D; 	import alternativa.engine3d.core.Object3D; 	import alternativa.engine3d.core.Object3DContainer; 	import alternativa.engine3d.core.Sorting; 	import alternativa.engine3d.core.View; 	import alternativa.engine3d.materials.FillMaterial; 	import alternativa.engine3d.materials.TextureMaterial; 	import alternativa.engine3d.objects.Sprite3D; 	import alternativa.engine3d.primitives.Box; 	import alternativa.engine3d.primitives.Plane; 	import alternativa.engine3d.primitives.Sphere; 	 	import flash.display.BitmapData; 	import flash.display.BlendMode; 	import flash.display.Sprite; 	import flash.display.StageAlign; 	import flash.display.StageQuality; 	import flash.display.StageScaleMode; 	import flash.events.Event; 	import flash.events.KeyboardEvent; 	import flash.filters.GlowFilter; 	import flash.geom.ColorTransform; 	import flash.geom.Vector3D; 	import flash.sampler.NewObjectSample; 	import flash.system.Capabilities; 	import flash.ui.Keyboard; 		 	[SWF(backgroundColor="#000000", frameRate="100", width="640", height="480")] 	public class alternativa3dSokoban extends Sprite  	{ 		private const CUBESIZE:Number=10; 		//embeding textures images 		[Embed(source="resource/crateTextureImg.jpg")] static private const crateTextureImg:Class; 		[Embed(source="resource/floorTextureImg.png")] static private const floorTextureImg:Class; 		[Embed(source="resource/crateTopTextureImg.jpg")] static private const crateTopTextureImg:Class; 		[Embed(source="resource/crateTopGoalTextureImg.jpg")] static private const crateTopGoalTextureImg:Class; 		[Embed(source="resource/wallTextureImg.png")] static private const wallTextureImg:Class; 		[Embed(source="resource/goalTextureImg.jpg")] static private const goalTextureImg:Class; 		[Embed(source="resource/playerTextureImg.jpg")] static private const playerTextureImg:Class; 		[Embed(source="resource/backBitmapImg.jpg")] static private const backTextureImg:Class; 		[Embed(source="resource/backBottomBitmapImg.jpg")] static private const backBottomTextureImg:Class;  		// sokobal demo level and player position 		private var levels:Array=[[1,1,1,1,0,0,0,0],[1,0,0,1,1,1,1,1],[1,0,2,0,0,3,0,1],[1,0,3,0,0,2,4,1],[1,1,1,0,0,1,1,1],[0,0,1,1,1,1,0,0]]; 		private var playerCol:uint; 		private var playerRow:uint; 		private var playerRotation:Number=0; 		private var playerAngle:Number=0; 		private var playerMovement:Number=0; 		private var dRow:int; 		private var dCol:int; 		 		// alternativa3d  engine variables 		private var camera:Camera3D; 		private var controller:SimpleObjectController; 		private var container:ConflictContainer;			 		private var frame:Sprite = new Sprite(); 		public var player:Sphere;// Sphere primitive representing the player 		public var cplayer:SimpleObjectController; //controller for player object 		public var conplayer:Object3DContainer; //container for player 		private var movingCrate:Box;// cube primitive representing the moving crate		 			 		// textures		 		private var crateTexture:TextureMaterial = new TextureMaterial(new crateTextureImg().bitmapData); 		private var floorTexture:TextureMaterial = new TextureMaterial(new floorTextureImg().bitmapData); 		private var crateTopTexture:TextureMaterial = new TextureMaterial(new crateTopTextureImg().bitmapData); 		private var crateTopGoalTexture:TextureMaterial = new TextureMaterial(new crateTopGoalTextureImg().bitmapData); 		private var wallTexture:TextureMaterial = new TextureMaterial(new wallTextureImg().bitmapData); 		private var goalTexture:TextureMaterial = new TextureMaterial(new goalTextureImg().bitmapData); 		private var playerTexture:TextureMaterial = new TextureMaterial(new playerTextureImg().bitmapData); 		// SkyBox textures 		private var backTexture:TextureMaterial = new TextureMaterial(new backTextureImg().bitmapData); 		private var backBottomTexture:TextureMaterial = new TextureMaterial(new backBottomTextureImg().bitmapData); 						 		public function alternativa3dSokoban()  		{			 			stage.scaleMode = StageScaleMode.NO_SCALE; 			stage.align = StageAlign.TOP_LEFT; 			stage.quality = StageQuality.BEST; 			 			// Camera 			camera = new Camera3D(); 			camera.view = new View(640, 480); 			addChild(camera.view); 						 			// Camera controller 			controller = new SimpleObjectController(stage, camera, 200, 3); 			 			// Root object 			container = new ConflictContainer(); 			container.resolveByAABB = true; 			container.resolveByOOBB = true; 			 			//Player controller 			conplayer = new Object3DContainer(); 			cplayer = new SimpleObjectController(stage, player, 3); 			 //i am not shure about SkyBox in Alternativa and will prepare it manually 			var backBottom:Plane = new Plane(200*CUBESIZE/2,200*CUBESIZE/2); 			backBottom.setMaterialToAllFaces(backBottomTexture); 			backBottom.x = 0; 			backBottom.y = -100*CUBESIZE/2; 			backBottom.z = 0; 			backBottom.rotationX = 90*Math.PI/180; 			container.addChild(backBottom); 			 			var backLeft:Plane = new Plane(200*CUBESIZE/2,200*CUBESIZE/2); 			backLeft.setMaterialToAllFaces(backTexture); 			backLeft.x = 0; 			backLeft.y = 0; 			backLeft.z = 100*CUBESIZE/2; 			container.addChild(backLeft);  			var backRight:Plane = new Plane(200*CUBESIZE/2,200*CUBESIZE/2); 			backRight.setMaterialToAllFaces(backTexture); 			backRight.x = 0; 			backRight.y = 0; 			backRight.z = -100*CUBESIZE/2; 			container.addChild(backRight);  			var backFront:Plane = new Plane(200*CUBESIZE/2,200*CUBESIZE/2); 			backFront.setMaterialToAllFaces(backTexture); 			backFront.x = -100*CUBESIZE/2; 			backFront.y = 0; 			backFront.z = 0; 			backFront.rotationY = 90*Math.PI/180; 			container.addChild(backFront);  			var backBack:Plane = new Plane(200*CUBESIZE/2,200*CUBESIZE/2); 			backBack.setMaterialToAllFaces(backTexture); 			backBack.x = 100*CUBESIZE/2; 			backBack.y = 0; 			backBack.z = 0; 			backBack.rotationY = 90*Math.PI/180; 			container.addChild(backBack); // end SkyBox 			 			var box:Box; 			/* 			[[1,1,1,1,0,0,0,0], 			 [1,0,0,1,1,1,1,1], 			 [1,0,2,0,0,3,0,1], 			 [1,0,3,0,0,2,4,1], 			 [1,1,1,0,0,1,1,1], 			 [0,0,1,1,1,1,0,0]]; 			*/ 			// level construction 			for (var i:uint=0; i<6; i++)  			{ 				for (var j:uint=0; j<8; j++)  				{ 					switch (levels[i][j])  					{ 						case 0 : 							box = new Box(CUBESIZE,CUBESIZE/2,CUBESIZE,1,1); 							box.setMaterialToAllFaces(floorTexture); 							box.x = CUBESIZE*j; 							box.y = 0; 							box.z = CUBESIZE*i; 							container.addChild(box); 							break; 						case 1 : 							box = new Box(CUBESIZE,CUBESIZE/2,CUBESIZE,1); 							box.setMaterialToAllFaces(floorTexture); 							box.x = CUBESIZE*j; 							box.y = 0; 							box.z = CUBESIZE*i; 							container.addChild(box); 							 							box = new Box(CUBESIZE,CUBESIZE,CUBESIZE,1); 							box.setMaterialToAllFaces(wallTexture); 							box.x = CUBESIZE*j; 							box.y = CUBESIZE*3/4; 							box.z = CUBESIZE*i; 							container.addChild(box); 							break; 						case 2 : 							box = new Box(CUBESIZE,CUBESIZE/2,CUBESIZE,1); 							box.setMaterialToAllFaces(goalTexture); 							box.x = CUBESIZE*j; 							box.y = 0; 							box.z = CUBESIZE*i; 							container.addChild(box); 							break; 						case 3 : 							box = new Box(CUBESIZE,CUBESIZE/2,CUBESIZE,1); 							box.setMaterialToAllFaces(floorTexture); 							box.x = CUBESIZE*j; 							box.y = 0; 							box.z = CUBESIZE*i; 							container.addChild(box); 							box = new Box(CUBESIZE,CUBESIZE,CUBESIZE,1); 							box.name = "crate_"+i+"_"+j; 							box.setMaterialToAllFaces(crateTexture); 							box.x = CUBESIZE*j; 							box.y = CUBESIZE*3/4; 							box.z = CUBESIZE*i; 							box.rotationX -= 90*Math.PI/180; 							// top of the crate 							box.faces[4].material=crateTopTexture; 							box.faces[5].material=crateTopTexture;  							container.addChild(box); 							break; 						case 4 : 							box = new Box(CUBESIZE,CUBESIZE/2,CUBESIZE,1); 							box.setMaterialToAllFaces(floorTexture); 							box.x = CUBESIZE*j; 							box.y = 0; 							box.z = CUBESIZE*i; 							container.addChild(box); 														 							player = new Sphere(CUBESIZE/2,16,16,false,playerTexture);  							conplayer.addChild(player); 							conplayer.visible = true; 							conplayer.x = CUBESIZE*j; 							conplayer.y = CUBESIZE*3/4; 							conplayer.z = CUBESIZE*i; 							conplayer.rotationX -= 90*Math.PI/180; 							container.addChild(conplayer); 							playerCol=j; 							playerRow=i; 							break; 					} 				} 			}  			// Adding camera 			container.addChild(camera); 			 			// View frame 			addChild(frame);												 			onResize();		 			stage.addEventListener(Event.ENTER_FRAME, updateEvent);			 			stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDwn);		 			stage.addEventListener(Event.RESIZE, onResize); 		}  		private function onKeyDwn(e:KeyboardEvent):void  		{ 			if (playerRotation==0&&playerMovement==0)  			{ 				switch (e.keyCode)  				{ 					case Keyboard.LEFT : 						playerRotation=+9; 						playerAngle+=90; 						break; 					case Keyboard.RIGHT : 						playerRotation=-9; 						playerAngle-=90; 						break; 					case Keyboard.UP : 						movingCrate=null; 						playerAngle=Math.round(conplayer.rotationY*180/Math.PI)%360; 						if (playerAngle<0)  						{ 							playerAngle+=360; 						} 						// we have to determine the difference between current row and column 						// and the new row and column according to player heading 						switch (playerAngle)  						{ 							case 0 : 								dRow=0; 								dCol=-1; 								break; 							case 90 : 								//dRow=-1; 								dRow=1; 								dCol=0; 								break; 							case 180 : 								dRow=0; 								dCol=1; 								break; 							case 270 : 								//dRow=1; 								dRow=-1; 								dCol=0; 								break; 						} 						if (levels[playerRow+dRow][playerCol+dCol]==0||levels[playerRow+dRow][playerCol+dCol]==2)  						{ 							// the player can move 							playerMovement=-CUBESIZE/10; 						}  						else  						{ 							if (levels[playerRow+dRow][playerCol+dCol]==3||levels[playerRow+dRow][playerCol+dCol]==5) { 								if (levels[playerRow+2*dRow][playerCol+2*dCol]==0||levels[playerRow+2*dRow][playerCol+2*dCol]==2) { 									// the player can move and can push a crate 									movingCrate=container.getChildByName("crate_"+(playerRow+dRow)+"_"+(playerCol+dCol))as Box; 									playerMovement=-CUBESIZE/10; 								} 							} 						} 						break;  				} 			} 		}   		public function updateEvent(e:Event):void  		{		 				if (playerRotation)  				{ 					conplayer.rotationY+=playerRotation*Math.PI/180; 					 					if (Math.abs(Math.round(conplayer.rotationY*180/Math.PI))%90==0) 					{ 						playerRotation=0; 					} 				} 				 				if (playerMovement)  				{					 					switch (playerAngle)  					{ 					case 0 : 						conplayer.x += playerMovement; 						player.rotationY -= 18*Math.PI/180; 					break; 					case 90 : 						conplayer.z += -playerMovement; 						player.rotationY -= 18*Math.PI/180; 					break; 					case 180 : 						conplayer.x += -playerMovement; 						player.rotationY -= 18*Math.PI/180; 						break; 					case 270 : 						conplayer.z += playerMovement; 						player.rotationY -= 18*Math.PI/180; 						break; 					} 					 					if (movingCrate)  					{ 						switch (playerAngle)  						{ 							case 0 : 								movingCrate.x += playerMovement; 								break; 							case 90 : 								movingCrate.z += -playerMovement; 								break; 							case 180 : 								movingCrate.x += -playerMovement; 								break; 							case 270 : 								movingCrate.z += playerMovement; 								break; 						} 					}  					// we need this to know if the player stopped on the destination tile 					if ((playerAngle%180==0&&(Math.round(conplayer.x*10)/10)%CUBESIZE==0)||(playerAngle%180!=0&&(Math.round(conplayer.z*10)/10)%CUBESIZE==0))  					{ 						playerMovement=0; 						levels[playerRow+dRow][playerCol+dCol]+=4; 						levels[playerRow][playerCol]-=4; 						if (movingCrate) { 							levels[playerRow+2*dRow][playerCol+2*dCol]+=3; 							if (levels[playerRow+2*dRow][playerCol+2*dCol]==5) { 								// changing materials on the fly 								movingCrate.setMaterialToAllFaces(crateTexture); 								// top of the crate on goal 								movingCrate.faces[4].material=crateTopGoalTexture; 								movingCrate.faces[5].material=crateTopGoalTexture;								  							} 							else  							{ 								//movingCrate.setMaterialToAllFaces(crateMaterial); 								movingCrate.setMaterialToAllFaces(crateTexture); 								// top of the crate 								movingCrate.faces[4].material=crateTopTexture; 								movingCrate.faces[5].material=crateTopTexture;								 							} 							levels[playerRow+dRow][playerCol+dCol]-=3; 							movingCrate.name="crate_"+(playerRow+2*dRow)+"_"+(playerCol+2*dCol); 						} 						playerCol+=dCol; 						playerRow+=dRow; 					} 				}  				onEnterFrame(); 		}			  		public function correct_camera_angles():void 		{ 			//set camera position 			var r:Number = 10*CUBESIZE/3;			 			var a:Number = -conplayer.rotationY; 			var cx:Number = conplayer.x+Math.cos(a)*r; 			var cz:Number = conplayer.z+Math.sin(a)*r; 			var cy:Number = conplayer.y+r;			 			controller.setObjectPosXYZ(cx,cy,cz); 			 			//look at player box 			controller.lookAtXYZ(conplayer.x,conplayer.y,conplayer.z); 			 			//correct camera angles			 				var cprotY:Number; 				 				cprotY=Math.round(conplayer.rotationY*180/Math.PI)%360;			 				if (cprotY<0)  				{ 					cprotY+=360; 				} 				if (cprotY>180) 				{ 					camera.rotationX = camera.rotationX + (90*Math.PI/180)*Math.sin((cprotY%180)*Math.PI/180); 				}										 				camera.rotationY = camera.rotationY+90*Math.PI/180-conplayer.rotationY; 		} 		 		public function onEnterFrame(e:Event = null):void  		{ 			controller.update(); 			correct_camera_angles(); 			cplayer.update(); 			camera.render();		 		} 		  		public function onResize(e:Event = null):void  		{ 			//here you can add border size for view 			var pd:Number = 0; 			camera.view.width = stage.stageWidth - pd*2; 			camera.view.height = stage.stageHeight - pd*2; 			camera.view.x = pd; 			camera.view.y = pd; 			 			frame.graphics.clear(); 			frame.graphics.beginFill(0x000000, 0); 			frame.graphics.drawRect(0, 0, stage.stageWidth, stage.stageHeight); 			//frame.graphics.lineStyle(0, 0x7F7F7F); 			frame.graphics.drawRect(pd, pd, camera.view.width, camera.view.height); 			frame.graphics.endFill(); 		} 	} }

Here you can download sources.



gembin 2012-07-21 22:58 鍙戣〃璇勮
]]>
Embedding fonts into ActionScript 3 project - ▼幸运赛车规则▼幸运赛车投注▼幸运赛车开奖结果查询▼湖南幸运赛车开奖奖金▼幸运赛车走势▼//www.cqk4s.cn/gembin/archive/2012/07/21/383676.htmlgembingembinSat, 21 Jul 2012 14:56:00 GMT//www.cqk4s.cn/gembin/archive/2012/07/21/383676.html//www.cqk4s.cn/gembin/comments/383676.html//www.cqk4s.cn/gembin/archive/2012/07/21/383676.html#Feedback0//www.cqk4s.cn/gembin/comments/commentRss/383676.html//www.cqk4s.cn/gembin/services/trackbacks/383676.html闃呰鍏ㄦ枃

gembin 2012-07-21 22:56 鍙戣〃璇勮
]]>
Setting up the VNC Server in Mac OS X Lion - ▼幸运赛车规则▼幸运赛车投注▼幸运赛车开奖结果查询▼湖南幸运赛车开奖奖金▼幸运赛车走势▼//www.cqk4s.cn/gembin/archive/2012/07/14/383070.htmlgembingembinFri, 13 Jul 2012 16:00:00 GMT//www.cqk4s.cn/gembin/archive/2012/07/14/383070.html//www.cqk4s.cn/gembin/comments/383070.html//www.cqk4s.cn/gembin/archive/2012/07/14/383070.html#Feedback0//www.cqk4s.cn/gembin/comments/commentRss/383070.html//www.cqk4s.cn/gembin/services/trackbacks/383070.html

VNC server is included in every edition of Mac OS X, including Mac OS X 10.6 –aka Snow Leopard. You can start the server through a hidden check box in the Sharing preferences.

VNC server lets you control your Mac from another computer using the VNCprotocol. With recent editions of Mac OS X, Apple has moved to a more sophisticated method of screen sharing. However, a traditional VNC server is still included but is turned off by default.

Starting the Mac OS X VNC Server
  1. Launch the System Preferences.

    Launch the System Preferences

    Launch the System Preferences

  2. Select the Sharingpreferences.

    Select the Sharing preferences icon

    Select the Sharing preferences icon

  3. Enable Screen Sharing within the Servicelist.

    Enable the Screen Sharing service

    Enable the Screen Sharing service

  4. Click Computer Settings…to show the VNC password setting.

    Enable VNC and choose a password

    Enable VNC and choose a password

  5. Enable VNC viewers may control screen with password:.
  6. Enter a strong password.
  7. Click OK to save your settings.

Your Mac is now running a traditional VNC server. You can now connect to your Mac using a VNC client running on another Mac, Windows, or Linux computer.

NOTE: the default vnc listening port is 5900



gembin 2012-07-14 00:00 鍙戣〃璇勮
]]>
Enable Telnet in MAC OS X Lion - ▼幸运赛车规则▼幸运赛车投注▼幸运赛车开奖结果查询▼湖南幸运赛车开奖奖金▼幸运赛车走势▼//www.cqk4s.cn/gembin/archive/2012/07/13/383063.htmlgembingembinFri, 13 Jul 2012 14:43:00 GMT//www.cqk4s.cn/gembin/archive/2012/07/13/383063.html//www.cqk4s.cn/gembin/comments/383063.html//www.cqk4s.cn/gembin/archive/2012/07/13/383063.html#Feedback0//www.cqk4s.cn/gembin/comments/commentRss/383063.html//www.cqk4s.cn/gembin/services/trackbacks/383063.html[gembin@localhost bin]$ sudo launchctl
Password:
launchd% 
launchd% load -F /System/Library/LaunchDaemons/telnet.plist
launchd% exit

and now the telnet is enabled, try to test it.
[gembin@localhost bin]$ telnet localhost
Trying ::1...
Connected to localhost.
Escape character is '^]'.
login: gembin
Password:
Last login: Fri Jul 13 22:21:08 on ttys002


gembin 2012-07-13 22:43 鍙戣〃璇勮
]]>
Comparing the syntax of Java 5 and ActionScript 3 - ▼幸运赛车规则▼幸运赛车投注▼幸运赛车开奖结果查询▼湖南幸运赛车开奖奖金▼幸运赛车走势▼//www.cqk4s.cn/gembin/archive/2012/07/07/382482.htmlgembingembinSat, 07 Jul 2012 14:44:00 GMT//www.cqk4s.cn/gembin/archive/2012/07/07/382482.html//www.cqk4s.cn/gembin/comments/382482.html//www.cqk4s.cn/gembin/archive/2012/07/07/382482.html#Feedback0//www.cqk4s.cn/gembin/comments/commentRss/382482.html//www.cqk4s.cn/gembin/services/trackbacks/382482.html

This list is not complete, and your input is appreciated.

Concept/Language Construct

Java 5.0

ActionScript 3.0

Class library packaging

.jar

.swc

Inheritance

class Employee extends Person{…}

class Employee extends Person{…}

Variable declaration and initialization

String firstName=”John”;

Date shipDate=new Date();

int i;

int a, b=10;

double salary;

var firstName:String=”John”;

var shipDate:Date=new Date();

var i:int;

var a:int, b:int=10;

var salary:Number;

Undeclared variables

n/a

It’s an equivalent to the wild card type notation *. If you declare a variable but do not specify its type, the * type will apply.

A default value: undefined

var myVar:*;

Variable scopes

block: declared within curly braces,
local: declared within a method or a block

member: declared on the class level

no global variables

No block scope: the minimal scope is a function

local: declared within a function

member: declared on the class level

If a variable is declared outside of any function or class definition, it has global scope.

Strings

Immutable, store sequences of two-byte Unicode characters

Immutable, store sequences of two-byte Unicode characters

Terminating statements with semicolons

A must

If you write one statement per line you can omit it.

Strict equality operator

n/a

===

for strict non-equality use

!==

Constant qualifier

The keyword final

final int STATE=”NY”;

The keyword const

const STATE:int =”NY”;

Type checking

Static (checked at compile time)

Dynamic (checked at run-time) and static (it’s so called ‘strict mode’, which is default in Flex Builder)

Type check operator

instanceof

is – checks data type, i.e. if (myVar is String){…}

The is operator is a replacement of older instanceof

The as operator

n/a

Similar to is operator, but returns not Boolean, but the result of expression:

var orderId:String=”123”;

var orderIdN:Number=orderId as Number;

trace(orderIdN);//prints 123

Primitives

byte, int, long, float, double,short, boolean, char

all primitives in ActionScript areobjects.
Boolean, int, uint, Number, String

The following lines are equivalent;

var age:int = 25;

var age:int = new int(25);

Complex types

n/a

Array, Date, Error, Function, RegExp, XML, and XMLList

Array declaration and instantiation

int quarterResults[];

quarterResults =
new int[4];

int quarterResults[]={25,33,56,84};

var quarterResults:Array
=new Array();

or

var quarterResults:Array=[];

var quarterResults:Array=
[25, 33, 56, 84];

AS3 also has associative arrays that uses named elements instead of numeric indexes (similar to Hashtable).

The top class in the inheritance tree

Object

Object

Casting syntax: cast the class Object to Person:

Person p=(Person) myObject;

var p:Person= Person(myObject);

or

var p:Person= myObject as Person;

upcasting

class Xyz extends Abc{}

Abc myObj = new Xyz();

class Xyz extends Abc{}

var myObj:Abc=new Xyz();

Un-typed variable

n/a

var myObject:*

var myObject:

packages

package com.xyz;

class myClass {…}

package com.xyz{

class myClass{…}

}

ActionScript packages can include not only classes, but separate functions as well

Class access levels

public, private, protected

if none is specified, classes have package access level

public, private, protected

if none is specified, classes haveinternal access level (similar to package access level in Java)

Custom access levels: namespaces

n/a

Similar to XML namespaces.

namespace abc;

abc function myCalc(){}

or

abc::myCalc(){}

use namespace abc ;

Console output

System.out.println();

// in debug mode only

trace();

imports

import com.abc.*;

import com.abc.MyClass;

import com.abc.*;

import com.abc.MyClass;

packages must be imported even if the class names are fully qualified in the code.

Unordered key-value pairs

Hashtable, Map

Hashtable friends = new Hashtable();

friends.put(“good”,
“Mary”);

friends.put(“best”,
“Bill”);

friends.put(“bad”,
“Masha”);

String bestFriend= friends.get(“best”);

// bestFriend is Bill

Associative Arrays

Allows referencing its elements by names instead of indexes.

var friends:Array=new Array();
friends["good"]=”Mary”;

friends["best"]=”Bill”;

friends["bad"]=”Masha”;

var bestFriend:String= friends[“best”]

friends.best=”Alex”;

Another syntax:

var car:Object = {make:”Toyota”, model:”Camry”};

trace (car["make"], car.model);

// Output: Toyota Camry

Hoisting

n/a

Compiler moves all variable declarations to the top of the function, so you can use a variable name even before it’s been explicitly declared in the code.

Instantiation objects from classes

Customer cmr = new Customer();

Class cls = Class.forName(“Customer”);

Object myObj= cls.newInstance();

var cmr:Customer = new Customer();

var cls:Class = flash.util.getClassByName(“Customer”);
var myObj:Object = new cls();

Private classes

private class myClass{…}

There is no private classes in AS3.

Private constructors

Supported. Typical use: singleton classes.

Not available. Implementation of private constructors is postponed as they are not the part of the ECMAScript standard yet.

To create a Singleton, use public static getInstance(), which sets a private flag instanceExists after the first instantiation. Check this flag in the public constructor, and if instanceExists==true, throw an error.

Class and file names

A file can have multiple class declarations, but only one of them can be public, and the file must have the same name as this class.

A file can have multiple class declarations, but only one of them can be placed inside the package declaration, and the file must have the same name as this class.

What can be placed in a package

Classes and interfaces

Classes, interfaces, variables, functions, namespaces, and executable statements.

Dynamic classes (define an object that can be altered at runtime by adding or changing properties and methods).

n/a

dynamic class Person {

var name:String;

}

//Dynamically add a variable // and a function

var p:Person = new Person();

p.name=”Joe”;

p.age=25;

p.printMe = function () {

trace (p.name, p.age);

}

p.printMe(); // Joe 25

function closures

n/a. Closure is a proposed addition to Java 7.

myButton.addEventListener(“click”, myMethod);

A closure is an object that represents a snapshot of a function with its lexical context (variable’s values, objects in the scope). A function closure can be passed as an argument and executed without being a part of any object

Abstract classes

supported

n/a

Function overriding

supported

Supported. You must use the override qualifier

Function overloading

supported

Not supported.

Interfaces

class A implements B{…}

interfaces can contain method declarations and final variables.

class A implements B{…}

interfaces can contain only function declarations.

Exception handling

Keywords: try, catch, throw, finally, throws

Uncaught exceptions are propagated to the calling method.

Keywords: try, catch, throw, finally

A method does not have to declare exceptions.

Can throw not only Error objects, but also numbers:

throw 25.3;

Flash Player terminates the script in case of uncaught exception.

Regular expressions

Supported

Supported




gembin 2012-07-07 22:44 鍙戣〃璇勮
]]>
MySQL basis - ▼幸运赛车规则▼幸运赛车投注▼幸运赛车开奖结果查询▼湖南幸运赛车开奖奖金▼幸运赛车走势▼//www.cqk4s.cn/gembin/archive/2012/05/22/378747.htmlgembingembinMon, 21 May 2012 16:25:00 GMT//www.cqk4s.cn/gembin/archive/2012/05/22/378747.html//www.cqk4s.cn/gembin/comments/378747.html//www.cqk4s.cn/gembin/archive/2012/05/22/378747.html#Feedback0//www.cqk4s.cn/gembin/comments/commentRss/378747.html//www.cqk4s.cn/gembin/services/trackbacks/378747.htmlbasic steps to play with mysql

# 1) login mysql with root
     mysql -u root -p
# 2) update password for root (optional)
UPDATE mysql.user SET password=PASSWORD('newPasswordForRoot'WHERE User='root';
FLUSH PRIVILEGES;

# 3) create a new user 'user1'

CREATE USER user1 IDENTIFIED BY 'mypassword'
# 4) grant all privileges for this user 
GRANT ALL PRIVILEGES ON *.* TO 'user1'@'localhost' IDENTIFIED BY 'mypassword'
FLUSH PRIVILEGES;

# 5) create a database with char set utf-8

create database mydatabase character set utf8;
set character_set_client=utf8;
set character_set_connection=utf8;
set character_set_database=utf8;
set character_set_results=utf8;
set character_set_server=utf8;


# 6) switch to a database
use mydatabase;
show tables;

# 7) Sample JDBC connection URL

jdbc:mysql://localhost:3306/mydatabase?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&failOverReadOnly=false




gembin 2012-05-22 00:25 鍙戣〃璇勮
]]>
Spring AOP: JDK Dynamic Proxy vs. CGLib proxy - ▼幸运赛车规则▼幸运赛车投注▼幸运赛车开奖结果查询▼湖南幸运赛车开奖奖金▼幸运赛车走势▼//www.cqk4s.cn/gembin/archive/2012/05/03/377268.htmlgembingembinThu, 03 May 2012 05:16:00 GMT//www.cqk4s.cn/gembin/archive/2012/05/03/377268.html//www.cqk4s.cn/gembin/comments/377268.html//www.cqk4s.cn/gembin/archive/2012/05/03/377268.html#Feedback0//www.cqk4s.cn/gembin/comments/commentRss/377268.html//www.cqk4s.cn/gembin/services/trackbacks/377268.htmlSpring's AOP is proxy-based. Spring provides two different options to create the proxies. One is based on JDK dynamic proxies and works with interfaces, the other one utilizes CGLib and is based on classes. (That's why the property is called proxyTargetClass respectively proxy-target-class.) For the moment I just want to provide a quick summary on the pros and cons of both options:

JDK dynamic proxies:

  • The class has to implement interfaces. Otherwise you will get ClassCastExceptions saying that $Proxy0 can not be casted to the particular class.

  • Eventually dynamic proxies force you to program to interfaces since you can not cast the proxy to the class - a feature I really like about them.


CGLib proxies:

  • The proxies are created by sub-classing the actual class. This means wherever an instance of the class is used it is also possible to use the CGLib proxy.

  • The class needs to provide a default constructor, i.e. without any arguments. Otherwise you'll get an IllegalArgumentException: "Superclass has no null constructors but no arguments were given." This makes constructor injection impossible.

  • The proxying does not work with final methods since the proxy sub class can not override the class' implementation.

  • The CGLib proxy is final, so proxying a proxy does not work. You will get an IllegalArgumentException saying "Cannot subclass final class $Proxy0". But this feature is usually not needed anyway. 

  • Since two objects are created (the instance of the class and the proxy as instance of a sub class) the constructor is called twice. In general this should not matter. I consider changing the class' state based on constructor calls a code smell anyway.

  • You have CGLib as additional dependency.

    ref:  //static.springsource.org/spring/docs/3.1.1.RELEASE/spring-framework-reference/htmlsingle/spring-framework-reference.html#aop-introduction-proxies 




gembin 2012-05-03 13:16 鍙戣〃璇勮
]]>
Deep Copy And Shallow Copy - ▼幸运赛车规则▼幸运赛车投注▼幸运赛车开奖结果查询▼湖南幸运赛车开奖奖金▼幸运赛车走势▼//www.cqk4s.cn/gembin/archive/2012/04/07/373545.htmlgembingembinSat, 07 Apr 2012 10:41:00 GMT//www.cqk4s.cn/gembin/archive/2012/04/07/373545.html//www.cqk4s.cn/gembin/comments/373545.html//www.cqk4s.cn/gembin/archive/2012/04/07/373545.html#Feedback0//www.cqk4s.cn/gembin/comments/commentRss/373545.html//www.cqk4s.cn/gembin/services/trackbacks/373545.htmlLets first separate it out and see what each one means.

What is Shallow Copy?

Shallow copy is a bit-wise copy of an object. A new object is created that has an exact copy of the values in the original object. If any of the fields of the object are references to other objects, just the reference addresses are copied i.e., only the memory address is copied.

Shallow Copy

In this figure, the MainObject1 have fields "field1" of int type, and "ContainObject1" of ContainObject type. When you do a shallow copy of MainObject1, MainObject2 is created with "field3" containing the copied value of "field1" and still pointing to ContainObject1 itself. Observe here and you will find that since field1 is of primitive type, the values of it are copied to field3 but ContainedObject1 is an object, so MainObject2 is still pointing to ContainObject1. So any changes made to ContainObject1 in MainObject1 will reflect in MainObject2.

Now if this is shallow copy, lets see what's deep copy?

What is Deep Copy?

A deep copy copies all fields, and makes copies of dynamically allocated memory pointed to by the fields. A deep copy occurs when an object is copied along with the objects to which it refers.

Deep Copy

In this figure, the MainObject1 have fields "field1" of int type, and "ContainObject1" of ContainObject type. When you do a deep copy of MainObject1, MainObject2 is created with "field3" containing the copied value of "field1" and "ContainObject2" containing the copied value of ContainObject1.So any changes made to ContainObject1 in MainObject1 will not reflect in MainObject2.

Well, here we are with what shallow copy and deep copy are and obviously the difference between them. Now lets see how to implement them in java.

How to implement shallow copy in java?

Here is an example of Shallow Copy implementation

 1 class Subject {
 2 
 3   private String name;
 4 
 5   public String getName() {
 6     return name;
 7   }
 8 
 9   public void setName(String s) {
10     name = s;
11   }
12 
13   public Subject(String s) {
14     name = s;
15   }
16 }
17 
18 class Student implements Cloneable {
19   //Contained object
20   private Subject subj;
21 
22   private String name;
23 
24   public Subject getSubj() {
25     return subj;
26   }
27 
28   public String getName() {
29     return name;
30   }
31 
32   public void setName(String s) {
33     name = s;
34   }
35 
36   public Person(String s, String sub) {
37     name = s;
38     subj = new Subject(sub);
39   }
40 
41   public Object clone() {
42     //shallow copy
43     try {
44       return super.clone();
45     } catch (CloneNotSupportedException e) {
46       return null;
47     }
48   }
49 }
50 
51 public class CopyTest {
52 
53   public static void main(String[] args) {
54     //Original Object
55     Student stud = new Student("John", "Algebra");
56 
57     System.out.println("Original Object: " + stud.getName() + " - "
58         + stud.getSubject().getName());
59 
60     //Clone Object
61     Student clonedStud = (Student) stud.clone();
62 
63     System.out.println("Cloned Object: " + clonedStud.getName() + " - "
64         + clonedStud.getSubject().getName());
65 
66     stud.setStudentName("Dan");
67     stud.getSubject().setSubjectName("Physics");
68 
69     System.out.println("Original Object after it is updated: " 
70         + stud.getName() + " - " + stud.getStudent().getName());
71 
72     System.out.println("Cloned Object after updating original object: "
73         + clonedStud.getName() + " - " + clonedStud.getSubject().getName());
74 
75   }
76 }

Output is:
Original Object: John - Algebra
Cloned Object: John - Algebra
Original Object after it is updated: Dan - Physics
Cloned Object after updating original object: John - Physics

In this example, all I did is, implement the class that you want to copy with Clonable interface and override clone() method of Object class and call super.clone() in it. If you observe, the changes made to "name" field of original object (Student class) is not reflected in cloned object but the changes made to "name" field of contained object (Subject class) is reflected in cloned object. This is because the cloned object carries the memory address of the Subject object but not the actual values. Hence any updates on the Subject object in Original object will reflect in Cloned object.

 

How to implement deep copy in java?

Here is an example of Deep Copy implementation. This is the same example of Shallow Copy implementation and hence I didnt write the Subject and CopyTest classes as there is no change in them.

 1 class Student implements Cloneable {
 2   //Contained object
 3   private Subject subj;
 4 
 5   private String name;
 6 
 7   public Subject getSubj() {
 8     return subj;
 9   }
10 
11   public String getName() {
12     return name;
13   }
14 
15   public void setName(String s) {
16     name = s;
17   }
18 
19   public Person(String s, String sub) {
20     name = s;
21     subj = new Subject(sub);
22   }
23 
24   public Object clone() {
25     //deep copy
26     try {
27       //Deep copy
28       Student s = new Student(name, subj.getName());
29       return s;
30     } catch (CloneNotSupportedException e) {
31       return null;
32     }
33   }
34 }
 
 Output is:
 Original Object: John - Algebra
 Cloned Object: John - Algebra
 Original Object after it is updated: Dan - Physics
 Cloned Object after updating original object: Dan - Physics

 

Well, if you observe here in the "Student" class, you will see only the change in the "clone()" method. Since its a deep copy, you need to create an object of the cloned class. Well if you have have references in the Subject class, then you need to implement Cloneable interface in Subject class and override clone method in it and this goes on and on.

There is an alternative way for deep copy.

Yes, there is. You can do deep copy through serialization. What does serialization do? It writes out the whole object graph into a persistant store and read it back when needed, which means you will get a copy of the whole object graph whne you read it back. This is exactly what you want when you deep copy an object. Note, when you deep copy through serialization, you should make sure that all classes in the object's graph are serializable. Let me explain you this alternative way with an example.

 1 public class ColoredCircle implements Serializable
 2 {
 3     private int x;
 4     private int y;
 5 
 6     public ColoredCircle(int x, int y){
 7         this.x = x;
 8         this.y = y;
 9     }
10 
11     public int getX(){
12         return x;
13     }
14 
15     public void setX(int x){
16         this.x = x;
17     }
18 
19     public int getY(){
20         return y;
21     }
22 
23     public void setX(int x){
24         this.x = x;
25     }
26 }
27 
28 public class DeepCopy
29 {
30     static public void main(String[] args)
31     {
32         ObjectOutputStream oos = null;
33         ObjectInputStream ois = null;
34 
35         try
36         {
37             // create original serializable object
38             ColoredCircle c1 = new ColoredCircle(100,100);
39             // print it
40             System.out.println("Original = " + c1);
41 
42             ColoredCircle c2 = null;
43 
44             // deep copy
45             ByteArrayOutputStream bos = new ByteArrayOutputStream(); 
46             oos = new ObjectOutputStream(bos); 
47             // serialize and pass the object
48             oos.writeObject(c1);   
49             oos.flush();               
50             ByteArrayInputStream bin = 
51                     new ByteArrayInputStream(bos.toByteArray()); 
52             ois = new ObjectInputStream(bin);                  
53             // return the new object
54             c2 = ois.readObject(); 
55 
56             // verify it is the same
57             System.out.println("Copied   = " + c2);
58             // change the original object's contents
59             c1.setX(200);
60             c1.setY(200);
61             // see what is in each one now
62             System.out.println("Original = " + c1);
63             System.out.println("Copied   = " + c2);
64         }
65         catch(Exception e)
66         {
67             System.out.println("Exception in main = " +  e);
68         }
69         finally
70         {        
71             oos.close();
72             ois.close();
73         }
74     }
75 }

 The output is:
 Original = x=100,y=100
 Copied   = x=100,y=100
 Original = x=200,y=200
 Copied   = x=100,y=100

All you need to do here is:
  • Ensure that all classes in the object's graph are serializable.
  • Create input and output streams.
  • Use the input and output streams to create object input and object output streams.
  • Pass the object that you want to copy to the object output stream.
  • Read the new object from the object input stream and cast it back to the class of the object you sent.

In this example, I have created a ColoredCircle object, c1 and then serialized it (write it out to ByteArrayOutputStream). Then I deserialed the serialized object and saved it in c2. Later I modified the original object, c1. Then if you see the result, c1 is different from c2. c2 is deep copy of first version of c1. So its just a copy and not a reference. Now any modifications to c1 wont affect c2, the deep copy of first version of c1.

Well this approach has got its own limitations and issues:

As you cannot serialize a transient variable, using this approach you cannot copy the transient variables. 
Another issue is dealing with the case of a class whose object's instances within a virtual machine must be controlled. This is a special case of the Singleton pattern, in which a class has only one object within a VM. As discussed above, when you serialize an object, you create a totally new object that will not be unique. To get around this default behavior you can use the readResolve() method to force the stream to return an appropriate object rather than the one that was serialized. In this particular case, the appropriate object is the same one that was serialized.
Next one is the performance issue. Creating a socket, serializing an object, passing it through the socket, and then deserializing it is slow compared to calling methods in existing objects. I say, there will be vast difference in the performance. If your code is performance critical, I suggest dont go for this approach. It takes almost 100 times more time to deep copy the object than the way you do by implementing Clonable interface.

When to do shallow copy and deep copy?

Its very simple that if the object has only primitive fields, then obviously you will go for shallow copy but if the object has references to other objects, then based on the requiement, shallow copy or deep copy should be chosen. What I mean here is, if the references are not modified anytime, then there is no point in going for deep copy. You can just opt shallow copy. But if the references are modified often, then you need to go for deep copy. Again there is no hard and fast rule, it all depends on the requirement.

Finally lets have a word about rarely used option - Lazy copy

A lazy copy is a combination of both shallow copy and deep copy. When initially copying an object, a (fast) shallow copy is used. A counter is also used to track how many objects share the data. When the program wants to modify the original object, it can determine if the data is shared (by examining the counter) and can do a deep copy at that time if necessary.

Lazy copy looks to the outside just as a deep copy but takes advantage of the speed of a shallow copy whenever possible. It can be used when the references in the original object are not modified often. The downside are rather high but constant base costs because of the counter. Also, in certain situations, circular references can also cause problems.



gembin 2012-04-07 18:41 鍙戣〃璇勮
]]>
SAX vs. DOM - ▼幸运赛车规则▼幸运赛车投注▼幸运赛车开奖结果查询▼湖南幸运赛车开奖奖金▼幸运赛车走势▼//www.cqk4s.cn/gembin/archive/2012/04/01/373206.htmlgembingembinSun, 01 Apr 2012 08:32:00 GMT//www.cqk4s.cn/gembin/archive/2012/04/01/373206.html//www.cqk4s.cn/gembin/comments/373206.html//www.cqk4s.cn/gembin/archive/2012/04/01/373206.html#Feedback0//www.cqk4s.cn/gembin/comments/commentRss/373206.html//www.cqk4s.cn/gembin/services/trackbacks/373206.htmlWhile comparing two entities, we tend to see both of them as competitors and consequently comparing them to find a winner. This of course is not applicable in every case - not at least in the case of SAX and DOM. Both have their own pros and cons and they are certainly not in direct competition with each other.

SAX vs. DOM

Main differences between SAX and DOM, which are the two most popular APIs for processing XML documents in Java, are:-
  • Read v/s Read/Write: SAX can be used only for reading XML documents and not for the manipulation of the underlying XML data whereas DOM can be used for both read and write of the data in an XML document.
  • Sequential Access v/s Random Access: SAX can be used only for a sequential processing of an XML document whereas DOM can be used for a random processing of XML docs. So what to do if you want a random access to the underlying XML data while using SAX? You got to store and manage that information so that you can retrieve it when you need.
  • Call back v/s Tree: SAX uses call back mechanism and uses event-streams to read chunks of XML data into the memory in a sequential manner whereas DOM uses a tree representation of the underlying XML document and facilitates random access/manipulation of the underlying XML data.
  • XML-Dev mailing list v/s W3C: SAX was developed by the XML-Dev mailing list whereas DOM was developed by W3C (World Wide Web Consortium).
  • Information Set: SAX doesn't retain all the info of the underlying XML document such as comments whereas DOM retains almost all the info. New versions of SAX are trying to extend their coverage of information.
Usual Misconceptions
  • SAX is always faster: this is a very common misunderstanding and one should be aware that SAX may not always be faster because it might not enjoy the storage-size advantage in every case due to the cost of call backs depending upon the particular situation, SAX is being used in.
  • DOM always keeps the whole XML doc in memory: it's not always true. DOM implementations not only vary in their code size and performance, but also in their memory requirements and few of them don't keep the entire XML doc in memory all the time. Otherwise, processing/manipulation of very large XML docs may virtually become impossible using DOM, which is of course not the case.

How to choose one between the two?

It primarily depends upon the requirement. If the underlying XML data requires manipulation then almost always DOM will be used as SAX doesn't allow that. Similarly if the nature of access is random (for example, if you need contextual info at every stage) then DOM will be the way to go in most of the cases. But, if the XML document is only required to be read and that too sequentially, then SAX will probably be a better alternative in most of the cases. SAX was developed mainly for pasring XML documents and it's certainly good at it. SO, if you need to process an XML document maybe to update a datasource, SAX will probably make a alternative.
Requirements may certainly fall between the two extremes discussed above and for any such situation you should weight both the alternatives before picking any of the two. There are applications where a combination of both SAX and DOM are used for XML processing so that might also be an alternative in your case. But, basically it would be a design decision and evidently it would require a thorough analysis of the pros and cons of all possible approaches in that situation.


gembin 2012-04-01 16:32 鍙戣〃璇勮
]]>
Top Ten Reasons not to use the C shell - ▼幸运赛车规则▼幸运赛车投注▼幸运赛车开奖结果查询▼湖南幸运赛车开奖奖金▼幸运赛车走势▼//www.cqk4s.cn/gembin/archive/2012/04/01/373205.htmlgembingembinSun, 01 Apr 2012 08:30:00 GMT//www.cqk4s.cn/gembin/archive/2012/04/01/373205.html//www.cqk4s.cn/gembin/comments/373205.html//www.cqk4s.cn/gembin/archive/2012/04/01/373205.html#Feedback0//www.cqk4s.cn/gembin/comments/commentRss/373205.html//www.cqk4s.cn/gembin/services/trackbacks/373205.html //www.grymoire.com/Unix/CshTop10.txt

gembin 2012-04-01 16:30 鍙戣〃璇勮
]]>
Get substring of a string under UNIX/Linux - ▼幸运赛车规则▼幸运赛车投注▼幸运赛车开奖结果查询▼湖南幸运赛车开奖奖金▼幸运赛车走势▼//www.cqk4s.cn/gembin/archive/2012/04/01/373200.htmlgembingembinSun, 01 Apr 2012 07:38:00 GMT//www.cqk4s.cn/gembin/archive/2012/04/01/373200.html//www.cqk4s.cn/gembin/comments/373200.html//www.cqk4s.cn/gembin/archive/2012/04/01/373200.html#Feedback0//www.cqk4s.cn/gembin/comments/commentRss/373200.html//www.cqk4s.cn/gembin/services/trackbacks/373200.htmlthere many ways to do so.


str="hello world"

1) cut
Where -cN-M tells the cut command to return columns N to M, inclusive. 
cut -cN-M

start=1
end=5
sub_str=`echo ${str} | cut -c${start}-${end}`
output: hello

2) bash 
Note: if you are not sure of having bash, consider using cut. 
${str:offset}
$
{str:offset:length}

sub_str=${str:0:5}
output: hello

3) expr

expr substr string position length 
sub_str=`expr substr $str 1 5`
output: hello

 



gembin 2012-04-01 15:38 鍙戣〃璇勮
]]>
Get the length of a string under UNIX/Linux - ▼幸运赛车规则▼幸运赛车投注▼幸运赛车开奖结果查询▼湖南幸运赛车开奖奖金▼幸运赛车走势▼//www.cqk4s.cn/gembin/archive/2012/04/01/373199.htmlgembingembinSun, 01 Apr 2012 07:14:00 GMT//www.cqk4s.cn/gembin/archive/2012/04/01/373199.html//www.cqk4s.cn/gembin/comments/373199.html//www.cqk4s.cn/gembin/archive/2012/04/01/373199.html#Feedback0//www.cqk4s.cn/gembin/comments/commentRss/373199.html//www.cqk4s.cn/gembin/services/trackbacks/373199.htmlthere many ways to do so.

str="hello world"

len=`expr length ${str}`

len=${#str}

len=`echo ${str} | awk "{ print length }"`

len=`echo -n ${str} | wc -c` 

 



gembin 2012-04-01 15:14 鍙戣〃璇勮
]]>
TreeSet vs HashSet vs LinkedHashSet - ▼幸运赛车规则▼幸运赛车投注▼幸运赛车开奖结果查询▼湖南幸运赛车开奖奖金▼幸运赛车走势▼//www.cqk4s.cn/gembin/archive/2012/03/31/373111.htmlgembingembinSat, 31 Mar 2012 03:30:00 GMT//www.cqk4s.cn/gembin/archive/2012/03/31/373111.html//www.cqk4s.cn/gembin/comments/373111.html//www.cqk4s.cn/gembin/archive/2012/03/31/373111.html#Feedback0//www.cqk4s.cn/gembin/comments/commentRss/373111.html//www.cqk4s.cn/gembin/services/trackbacks/373111.html
TreeSetHashSetLinkedHashSet
public class TreeSet
extends AbstractSet
implements SortedSetCloneableSerializable
public class HashSet
extends AbstractSet
implements SetCloneableSerializable
public class LinkedHashSet
extends HashSet
implements SetCloneableSerializable
unique valuesunique valuesUnique values
It stores its elements in a red-black treeIt stores its elements in a hash tableis implemented as a hash table with a linked list running through it
Order : ascending orderundefinedinsertion order
Performance : Slowbetter than LinkedHashSethas fast adding to the start of the list, and fast deletion from the interior via iteration
operations (addremove and contains)operations (addremovecontains and size)operations (addcontains and remove)
add, addAll,ceiling,clear,clone,comparator,contains,
descendingIterator,descendingSet,first,floor,
hashSet,higher,isEmpty,iterator,last,lower,pollFirst,
remove,size,subSet,tailSet
addclearclonecontainsisEmpty,iteratorremovesizeaddclearclonecontainsisEmpty,iteratorremovesize
From AbstractSet:
equalshashCoderemoveAll
equalshashCoderemoveAllequalshashCoderemoveAll
containsAllretainAlltoArraytoArray,toStringAbstractCollection:
addAllcontainsAllretainAlltoArray,toArraytoString
addAllcontainsAllretainAlltoArray,toArraytoString
Set:
containsAllequalshashCoderemoveAll,retainAlltoArraytoArray
addAllcontainsAllequalshashCode,removeAllretainAlltoArraytoArrayaddaddAllclearcontainscontainsAll,equalshashCodeisEmptyiteratorremove,removeAllretainAllsizetoArraytoArray



gembin 2012-03-31 11:30 鍙戣〃璇勮
]]>
Objective-C NSString formatting - ▼幸运赛车规则▼幸运赛车投注▼幸运赛车开奖结果查询▼湖南幸运赛车开奖奖金▼幸运赛车走势▼//www.cqk4s.cn/gembin/archive/2012/03/04/371188.htmlgembingembinSat, 03 Mar 2012 16:27:00 GMT//www.cqk4s.cn/gembin/archive/2012/03/04/371188.html//www.cqk4s.cn/gembin/comments/371188.html//www.cqk4s.cn/gembin/archive/2012/03/04/371188.html#Feedback0//www.cqk4s.cn/gembin/comments/commentRss/371188.html//www.cqk4s.cn/gembin/services/trackbacks/371188.htmlThe format specifiers supported by the NSString formatting methods and CFString formatting
functions follow the IEEE printf specification; the specifiers are summarized in Table 1.
Note that you can also use the “n$” positional specifiers such as %1$@ %2$s.
For more details, see the IEEE printf specification. You can also use these format specifiers with the NSLog function.

Table 1 Format specifiers supported by the NSString formatting methods and CFString formatting functions
瀹氫箟璇存槑
%@Objective-C object, printed as the string returned by descriptionWithLocale: if available, or description otherwise. Also works with CFTypeRef objects, returning the result of the CFCopyDescription function.
%%‘%’ character
%d, %D, %iSigned 32-bit integer (int)
%u, %UUnsigned 32-bit integer (unsigned int)
%hiSigned 16-bit integer (short)
%huUnsigned 16-bit integer (unsigned short)
%qiSigned 64-bit integer (long long)
%quUnsigned 64-bit integer (unsigned long long)
%xUnsigned 32-bit integer (unsigned int), printed in hexadecimal using the digits 0–9 and lowercase a–f
%XUnsigned 32-bit integer (unsigned int), printed in hexadecimal using the digits 0–9 and uppercase A–F
%qxUnsigned 64-bit integer (unsigned long long), printed in hexadecimal using the digits 0–9 and lowercase a–f
%qXUnsigned 64-bit integer (unsigned long long), printed in hexadecimal using the digits 0–9 and uppercase A–F
%o, %OUnsigned 32-bit integer (unsigned int), printed in octal
%f64-bit floating-point number (double)
%e64-bit floating-point number (double), printed in scientific notation using a lowercase e to introduce the exponent
%E64-bit floating-point number (double), printed in scientific notation using an uppercase E to introduce the exponent
%g64-bit floating-point number (double), printed in the style of %e if the exponent is less than –4 or greater than or equal to the precision, in the style of %f otherwise
%G64-bit floating-point number (double), printed in the style of %E if the exponent is less than –4 or greater than or equal to the precision, in the style of %f otherwise
%c8-bit unsigned character (unsigned char), printed by NSLog() as an ASCII character, or, if not an ASCII character, in the octal format \\ddd or the Unicode hexadecimal format \\udddd, where d is a digit
%C16-bit Unicode character (unichar), printed by NSLog() as an ASCII character, or, if not an ASCII character, in the octal format \\ddd or the Unicode hexadecimal format \\udddd, where d is a digit
%sNull-terminated array of 8-bit unsigned characters. %s interprets its input in the system encoding rather than, for example, UTF-8.
%SNull-terminated array of 16-bit Unicode characters
%pVoid pointer (void *), printed in hexadecimal with the digits 0–9 and lowercase a–f, with a leading 0x
%LLength modifier specifying that a following a, A, e, E, f, F, g, or G conversion specifier applies to a long double argument
%a64-bit floating-point number (double), printed in scientific notation with a leading 0x and one hexadecimal digit before the decimal point using a lowercase p to introduce the exponent
%A64-bit floating-point number (double), printed in scientific notation with a leading 0X and one hexadecimal digit before the decimal point using a uppercase P to introduce the exponent
%F64-bit floating-point number (double), printed in decimal notation
%zLength modifier specifying that a following d, i, o, u, x, or X conversion specifier applies to a size_t or the corresponding signed integer type argument
%tLength modifier specifying that a following d, i, o, u, x, or X conversion specifier applies to a ptrdiff_t or the corresponding unsigned integer type argument
%jLength modifier specifying that a following d, i, o, u, x, or X conversion specifier applies to a intmax_t or uintmax_t argument


Mac OS X uses several data types—NSInteger, NSUInteger,CGFloat, and CFIndex—to provide a
consistent means of representing values in 32- and 64-bit environments. In a 32-bit environment,
NSInteger and NSUInteger are defined as int and unsigned int, respectively. In 64-bit environments,
NSInteger and NSUInteger are defined as long and unsigned long, respectively. To avoid the need to
use different printf-style type specifiers depending on the platform, you can use the specifiers shown
in Table 2. Note that in some cases you may have to cast the value.

Table 2 Format specifiers for data types
绫诲瀷瀹氫箟寤鸿
NSInteger%ld or %lxCast the value to long
NSUInteger%lu or %lxCast the value to unsigned long
CGFloat%f or %g%f works for floats and doubles when formatting; but see below warning when scanning
CFIndex%ld or %lxThe same as NSInteger
pointer%p%p adds 0x to the beginning of the output. If you don’t want that, use %lx and cast to long.
long long%lld or %llxlong long is 64-bit on both 32- and 64-bit platforms
unsigned long long%llu or %llxunsigned long long is 64-bit on both 32- and 64-bit platforms

The following example illustrates the use of %ld to format an NSInteger and the use of a cast.

1
2
NSInteger i = 42;
printf("%ld\n", (long)i);

In addition to the considerations mentioned in Table 2, there is one extra case with scanning:
you must distinguish the types for float and double. You should use %f for float, %lf for double.
If you need to use scanf (or a variant thereof) with CGFloat, switch to double instead, and copy the double to CGFloat.

1
2
3
4
CGFloat imageWidth;
double tmp;
sscanf (str, "%lf", &amp;tmp);
imageWidth = tmp;

It is important to remember that %lf does not represent CGFloat correctly on either 32- or 64-bit platforms.
This is unlike %ld, which works for long in all cases.







gembin 2012-03-04 00:27 鍙戣〃璇勮
]]>
Sharing Objective-C, Cocoa and iOS [ebooks] - ▼幸运赛车规则▼幸运赛车投注▼幸运赛车开奖结果查询▼湖南幸运赛车开奖奖金▼幸运赛车走势▼//www.cqk4s.cn/gembin/archive/2012/03/03/371166.htmlgembingembinSat, 03 Mar 2012 07:43:00 GMT//www.cqk4s.cn/gembin/archive/2012/03/03/371166.html//www.cqk4s.cn/gembin/comments/371166.html//www.cqk4s.cn/gembin/archive/2012/03/03/371166.html#Feedback2//www.cqk4s.cn/gembin/comments/commentRss/371166.html//www.cqk4s.cn/gembin/services/trackbacks/371166.htmli got several objective-c & iOS related books collected from the internet for sharing.


Hope u will like it.






































































Pro_Objective-C_Design_Patterns_for_iOS.pdf


=====================================
=  others
=====================================

Learn_Objective-C_for_Java_Developers.pdf








gembin 2012-03-03 15:43 鍙戣〃璇勮
]]>
Giulia - Ce Frumoasa E Iubirea (鐖辨儏澶氱編涓? - ▼幸运赛车规则▼幸运赛车投注▼幸运赛车开奖结果查询▼湖南幸运赛车开奖奖金▼幸运赛车走势▼//www.cqk4s.cn/gembin/archive/2012/01/21/368811.htmlgembingembinSat, 21 Jan 2012 03:21:00 GMT//www.cqk4s.cn/gembin/archive/2012/01/21/368811.html//www.cqk4s.cn/gembin/comments/368811.html//www.cqk4s.cn/gembin/archive/2012/01/21/368811.html#Feedback0//www.cqk4s.cn/gembin/comments/commentRss/368811.html//www.cqk4s.cn/gembin/services/trackbacks/368811.html
Ce frumoasa e iubirea 鐖辨儏澶氱編涓?
Fiecare clipa pictata-n roz, 姣忎竴鍒嗘瘡涓绉掗兘娑傛垚浜嗙帿鐟拌壊
Tre'sa recunosc,iti apartine... 鎴戝繀椤诲緱鎵胯锛岃繖灞炰簬浣?
Si nici macar eu nu ma cunosc 鎴戝凡鏃犳硶璁よ瘑鑷繁
Asa cum ma stii pe mine.. 鍙湁浣犱簡瑙g湡姝g殑鎴?
Ma tem uneori ca ai sa pleci 鏈夋椂鍊欐垜鎷呭績浣犲皢绂诲幓锛?
Si nu vreau sa ma lasi fara tine...涓嶈鐣欎笅瀛ゅ崟鐨勬垜
Iar eu nu sunt eu...鑰屾垜宸蹭笉鏄垜锛?
De fapt,fara tine,sunt nimeni...浜嬪疄涓婏紝娌℃湁浣狅紝鎴戜篃灏嗘棤娉曞瓨鍦?
Refren: Ce frumoasa e iubirea 锛岀埍鎯呭缇庡憖锛?
Cand ma alinti cu zambetul tau curat! 褰撲綘鐢ㄧ函娲佺殑寰瑧鐖辨姎鎴戞椂
Ce frumoasa e iubirea 鐖辨儏澶氱編鍛
Cand tot ce spui devine adevarat!褰撲綘璇寸殑璇濇垚鐪熺殑閭d竴鍒?
(bis)

Ficare clipa trecuta-n alb 鐧芥棩閲屽害杩囩殑姣忎竴鍒?
A insemna ca tu esti departe 鍛婅瘔浣犲凡璧拌繙
Uneori ma intreb daca esti real 鏈夋椂鍊欐垜闂嚜宸变綘鏄惁鐪熺殑瀛樺湪
Sau inchipuit din printr-o carte! 涔熻浣犲彧鏄功涓殑铏氬够
Ma tem uneori ca ai sa pleci 鏈夋椂鎷呭績浣犱細绂诲幓
Si nu vreau sa ma lasi fara tine... 涓嶈鐣欎笅瀛ゅ崟鐨勬垜
Iar eu nu sunt eu... 鑰屾垜宸蹭笉鏄垜
De fapt,fara tine,sunt nimeni... 娌℃湁浣狅紝鎴戜篃灏嗕笉鍐嶅瓨鍦?
Refren: Ce frumoasa e iubirea 鐖辨儏澶氱編鍛
Cand ma alinti cu zambetul tau curat! 褰撲綘鐢ㄧ函娲佺殑寰瑧鐖辨姎鎴戞椂
Ce frumoasa e iubirea 鐖辨儏澶氱編鍛
Cand tot ce spui devine adevarat! 褰撲綘鐨勮瘽璇垚鐪熸椂
(bis)
Ma cuprinzi incet..ma stangi la piept 鎱㈡參灏嗘垜鎷ュ叆鎬涓?
Imi spui ca nu..n-ai sa pleci prea curand... 瀵规垜璇翠笉銆傘傘備笉瑕侀┈涓婄珛寮鎴?
(bis)
Refren: Ce frumoasa e iubirea 鐖辨儏澶氱編鍛
Cand ma alinti cu zambetul tau curat! 褰撲綘鐢ㄧ函娲佺殑寰瑧鐖辨姎鎴戞椂
Ce frumoasa e iubirea 鐖辨儏澶氱編鍛
Cand tot ce spui devine adevarat! 褰撲綘鐨勮瘽璇垚鐪熸椂
(bis)


gembin 2012-01-21 11:21 鍙戣〃璇勮
]]>
Mac Keyboard Shortcuts - ▼幸运赛车规则▼幸运赛车投注▼幸运赛车开奖结果查询▼湖南幸运赛车开奖奖金▼幸运赛车走势▼//www.cqk4s.cn/gembin/archive/2012/01/21/368798.htmlgembingembinFri, 20 Jan 2012 16:57:00 GMT//www.cqk4s.cn/gembin/archive/2012/01/21/368798.html//www.cqk4s.cn/gembin/comments/368798.html//www.cqk4s.cn/gembin/archive/2012/01/21/368798.html#Feedback0//www.cqk4s.cn/gembin/comments/commentRss/368798.html//www.cqk4s.cn/gembin/services/trackbacks/368798.html闃呰鍏ㄦ枃

gembin 2012-01-21 00:57 鍙戣〃璇勮
]]>
蹇冪悊瀛﹁嫳鏂囪瘝姹?/title><link>//www.cqk4s.cn/gembin/archive/2012/01/14/368493.html</link><dc:creator>gembin</dc:creator><author>gembin</author><pubDate>Sat, 14 Jan 2012 07:19:00 GMT</pubDate><guid>//www.cqk4s.cn/gembin/archive/2012/01/14/368493.html</guid><wfw:comment>//www.cqk4s.cn/gembin/comments/368493.html</wfw:comment><comments>//www.cqk4s.cn/gembin/archive/2012/01/14/368493.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>//www.cqk4s.cn/gembin/comments/commentRss/368493.html</wfw:commentRss><trackback:ping>//www.cqk4s.cn/gembin/services/trackbacks/368493.html</trackback:ping><description><![CDATA[     鎽樿: 蹇冪悊瀛?psychology蹇冪悊鐜拌薄 mental phenomenon蹇冪悊杩囩▼ mental process蹇冪悊鐘舵?mental state蹇冪悊娲诲姩 mental activity鎰忚瘑 consciousness蹇冪悊缁村害 psychological dimension蹇冪悊杩愬姩 psychomotor鍐呴儴娲诲姩 internal activity鏅氬績鐞嗗 general psychology瀹為獙...  <a href='//www.cqk4s.cn/gembin/archive/2012/01/14/368493.html'>闃呰鍏ㄦ枃</a><img src ="//www.cqk4s.cn/gembin/aggbug/368493.html" width = "1" height = "1" /><br><br><div align=right><a href="//www.cqk4s.cn/" title="幸运赛车规则">幸运赛车规则</a> 2012-01-14 15:19 <a href="//www.cqk4s.cn/gembin/archive/2012/01/14/368493.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item></channel></rss><li><a href="//www.cqk4s.cn/9je94/79271110.html ">苹果-热门标签-华商生活 </a> 2019-03-10</li> <li><a href="//www.cqk4s.cn/99l715/7242659.html ">“奥运新秀”亮相上海 亚帆联杯等你来看 </a> 2019-03-07</li> <li><a href="//www.cqk4s.cn/24w911/766878.html ">蔡奇就历史文化遗产保护调研:把燕都金中都建设保护好 </a> 2019-02-23</li> <li><a href="//www.cqk4s.cn/248335/560927.html ">红曲美的绿盒子,绿色生活大不同 </a> 2019-02-23</li> <li><a href="//www.cqk4s.cn/204418/5197476.html ">理发迎接世界杯 梅西粉丝将偶像笑脸“抛在脑后” </a> 2018-11-26</li> <li><a href="//www.cqk4s.cn/680818/2191485.html ">我省各类创业孵化载体累计“毕业”企业3054家 </a> 2018-11-26</li> <li><a href="//www.cqk4s.cn/t90786/147194.html ">鸿山慈善会厦门佛事展举行义诊活动 赢得群众交口称赞 </a> 2018-11-24</li> <li><a href="//www.cqk4s.cn/9ln897/5868343.html "> 特色小镇里的税收服务 定海国地税多措并举提升效能 </a> 2018-11-24</li> <li><a href="//www.cqk4s.cn/x79344/5895182.html ">端午小长假我市旅游总收入同比增20.5% </a> 2018-08-12</li> <li><a href="//www.cqk4s.cn/3pj690/9143651.html ">[微笑]其实很简单就能破这个局:立法禁止通过房地产二次交易获利,炒房就会被杜绝,炒房一旦被杜绝,房价就会受正常供需关系影响波动在合理范围内。 </a> 2018-08-12</li> <script>(function(){ var src = (document.location.protocol == "") ? "//js.passport.qihucdn.com/11.0.1.js?f7a6bc378844a5df707c414e6b6fea33":"https://jspassport.ssl.qhimg.com/11.0.1.js?f7a6bc378844a5df707c414e6b6fea33"; document.write('<script src="' + src + '" id="sozz"><\/script>'); })(); </script>