锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲精品伦理在线,97人澡人人添人人爽欧美,黄页网址大全在线观看http://www.aygfsteel.com/jiangshachina/category/16087.html鍚屾槸Java鐖卞ソ鑰咃紝鐩擱綍蹇呮浘鐩歌瘑錛?lt;br>    a cup of Java, cheers!zh-cnSat, 17 Aug 2013 08:51:37 GMTSat, 17 Aug 2013 08:51:37 GMT60Oracle OpenWorld 2013(涓婃搗)(鍘?http://www.aygfsteel.com/jiangshachina/archive/2013/08/02/402274.htmlSha JiangSha JiangFri, 02 Aug 2013 03:50:00 GMThttp://www.aygfsteel.com/jiangshachina/archive/2013/08/02/402274.htmlhttp://www.aygfsteel.com/jiangshachina/comments/402274.htmlhttp://www.aygfsteel.com/jiangshachina/archive/2013/08/02/402274.html#Feedback0http://www.aygfsteel.com/jiangshachina/comments/commentRss/402274.htmlhttp://www.aygfsteel.com/jiangshachina/services/trackbacks/402274.html
Oracle OpenWorld 2013(涓婃搗)
Oracle OpenWorld 2013(涓婃搗)宸茬粡緇撴潫錛屾垜鍏ㄧ▼鍙備笌浜嗘嬈℃妧鏈ぇ浼?xì)銆傛湰鏂囨槸鎴戝弬浼?xì)鐨勬墍瑙併佹墍闂匯佹墍鎬濅笌鎵鎰燂紝鏈夋枃錛屾湁鍥撅紝涓旀棤鐮併?2013.08.03鏈鍚庢洿鏂?

Oracle OpenWorld 2013(Shanghai) lasted four days, and included over 300 keynotes, sessions and hands-on labs. 18000+ attendees, including company leaders, industries experts and developers, joined the event, which was said the biggest IT activity in Asia-Pacific area as never before.

Sessions
* Java strategy/technical keynote
Every JavaOne conference must has such keynote, which introduces and demonstrates the latest new JDK versions and features, and prospects upcoming JDK version and features. All parts of Java ecosystem, including JME, JSE, JEE and JavaFX, are involved in the keynote. I was deeply impressed by JavaFX demo by Jim Weaver. The Java champion played musical instruments with a JavaFX application; that's really cool. In this JavaOne, JavaFX has a separated track, and the technology is very highlighted by Oracle. The software giant expects JavaFX to enhance Java's performance on rich application. But outspokenly, it's difficult to take end users to install a JRE beforehand if they just want to run a desktop application.


* Why should I switch to Java SE 7?
JDK 6 has rested in peace(exactly, the version isn't completely frozen), and JDK 7 has been released for two years, and even JDK 8 will come next March. But do you migrate your JRE to Java 7? Strings in switch statements, diamond operator, try with resources, multi-catch statement, ... Do you like the compiler sugar? Anyway, the features could improve development productivity. But fork-join framework really touches my heart. Because of complete backward compatibility, you just need to run your application in the new platform, and the performance could be accelerated.

* The road to Lambda
Java has been being criticised for implementing modern language features, like closure. The argument around closure implementation has lasted for a long time. Finally, Lambda, the closure for Java, has been finished, and will be distributed with JDK 8. Lambda is regarded as the biggest change since Generics in Java 5. Function Programming (FP) is popular, and Java developers can utilise Lambda expression to apply FP. And JDK 8 extends Collection framework to take advantage of Lambda as powerful as possible. For example, currently we need an iterator or loop to iterate a Collection container, that's so-called external iteration. JDK 8 adds a new method forEach() for Collection interface, and we can iterate a Collection object via internal iteration, that means it's no need to care the iteration details by developers. In fact, it's impossible to debug the iterating process. And the process may apply fork-join if possible to improve performance. That sounds cool!

* Effective Scala
Dynamic programming languages are emerging, and more languages, such as Groovy, Scala and Clojure, can run on JVM, and JDK 7 introduced a new instruction "invokeDynamic" to support dynamic languages better. Therefore, I have to pay some attention to other JVM languages. The session "Effective Scala" was provided by TypeSafe, a company founded by Scala creators; Spring founder Rod Johnson joined the company as member of board of directors last year. The session simulated the style of Effective Java, and also introduced some best practices and coding regulations. Frankly, I don't know Scala syntax, like traits, totally, so I don't understand the lecture exactly. But I still obtained something new, like Cake pattern. Do you know the design pattern? I never hear it before this session, but the pattern is well-known in Scala world. It's time to learn another language, and I think Groovy is a good start-up due to it is closer to Java.

* Taobao GCIH

Taobao creates GCIH (GC Invisible Heap) based on Oracle VM Hotspot, and allows different VM to access a shared heap. In Taobao business scenario, the shared heap only stores read-only objects. All of the objects are initialized after the application is launched, and not be cleaned before the application shutdowns. Therefore, single VM can consume less memory, that means we can deploy more VMs in single machine. And GCIH cannot be accessed by GC so that reducing the garbage collection overhead.

* What do you mean, backwards compatibility?
10gen, the company behind MongoDB, presented the topic. Because old MongoDB driver isn't well designed, so it's difficult to understand and use the driver API. For example, the driver has a lot of find() methods, but how do I know which one is my want. According to the session, method chaining not only makes codes more readable, and the idiom benefits the backward compatibility as well. Generally, method chaining only handle one parameter at each invoking, and application codes don't care the sequence of invoking. In this case, it's no need to provide the methods with several arguments, and the methods are possible to be deprecated in later time due to their ambiguity. Of course, method chaining isn't designed for backward compatibility. And applying backward compatibility is still a hard job, because you don't know what would happen in the future. In fact, many and many APIs are deprecated in later JDK versions.

Appreciation Party
In the third evening, Oracle catered a small but exciting party to every attendee. Beer, snacks, professional band, beautiful girls, hot performances, ... were on the stage. All of performances were shown by Oracle employees, and we just rock!



I was on the scene
In OTN lounge, I communicated with Jim Weaver and his assistant about JavaFX and UI testing. In this event, my small dream, taking a photo with Java mascot -- Duke, came true ^_^ Additionally, don't forget iron man :-)


Event Organization
This is my sixth SunTechDays/OOW, and I must say that the conference was organized the best this time. Professional agenda, considerate attendee service, delicious dessert and drinking, all of them, except for lunch, must be delighted.



Finally, I must say the event is well worth participating; join it, and enjoy it :-)


Sha Jiang 2013-08-02 11:50 鍙戣〃璇勮
]]>
涓栫晫涓鐩村湪鍙?鍘?http://www.aygfsteel.com/jiangshachina/archive/2013/07/14/401546.htmlSha JiangSha JiangSun, 14 Jul 2013 03:15:00 GMThttp://www.aygfsteel.com/jiangshachina/archive/2013/07/14/401546.htmlhttp://www.aygfsteel.com/jiangshachina/comments/401546.htmlhttp://www.aygfsteel.com/jiangshachina/archive/2013/07/14/401546.html#Feedback3http://www.aygfsteel.com/jiangshachina/comments/commentRss/401546.htmlhttp://www.aygfsteel.com/jiangshachina/services/trackbacks/401546.html
涓栫晫涓鐩村湪鍙?/span>
    鏈榪戞湁鐐瑰効闂詫紝鐪嬩簡涓浜涙枃绔狅紝鏈変簡涓浜涙劅瑙︼紝鍐欐垚涓綃囧皬鏂囥傝蔣浠朵笘鐣岀湡鐨勫彉鍖栧緢澶э紝娌℃湁姘告亽鐨勭粓緇撹呫備粖澶╃殑緇堢粨鑰咃紝鏄庡ぉ鍙兘灝變細(xì)琚埆浜虹粓緇撱傞亾鐞嗗ぇ瀹墮兘鎳傦紝浣嗙幇瀹炰緷鐒跺緢孌嬮叿銆?2013.07.29鏈鍚庢洿鏂?

    This week, I read some articles about some API and tools that developers, especially Java guys, must know. Fortunately, I really know some of them, but unfortunately, I really miss something.

    Please let me introduce some cases at first:
    1. In our real projects, we only use JDK 6, but the version had been in End-Of-Life; we never touch JDK 7, but JDK 8 is upcoming. I don't know how much time we would spend on accepting Lambda expression. In fact, at present, a lot of Java developers cannot understand Generics exactly, however the syntax has been introduced for more than 8 years. Of course, Java Generics is a bit ambiguous, so it may be difficult to understand.
    2. Ant was ever the standard for building, and it still being used by many projects, even new ones. Maven was designed to terminate Ant due to the older cannot make life easy. Some conceptions of Maven, such as build life cycle, dependency management, default directory structure, are very advanced. But Maven dependency and transitive dependency management is nightmare, you have to include/exclude this or that. And extending Maven is also a hard job. I have real experience on both of them, I even wrote some popular preliminary blogs about Maven several years ago. But what I really don't know? I don't know Maven is becoming legacy, and worse, a new super star Gradle is on stage. Outspokenly, I never hear of the artifact before this week :-( Outstanding Spring framework is a very case about the trend. At beginning, obviously Spring is built by Ant, then the framework switched to Maven some years ago, but last year Spring migrated to Gradle.
    3. Google-Collections was well-known if you used it or not, and I know Guava however I never use the API. But what I really don't know? I don't know google-collections was closed several years ago, and even it was combined by Guava, which is a new rock star in Java ecosystem.

銆銆OH, something is born, and then grows, and then rests in peace. That's nature, and we have to face it, but why I don't know? Exactly, I have no idea.
銆銆World has been changing, and is changing faster as never before. How to keep us up-to-date with new fashion? I think the question may be asked by every "old" developer. After a long term career life, some of us may become veteran, but absolutely, it's impossible that everyone become expert, particularly the expert in underlying fields. We just be proficient in some programming languages, frameworks, APIs, or tools. So we must update our brains continuously.
銆銆Maybe the issue is one of the middle life crisis problems, good luck for you and me :-)

Sha Jiang 2013-07-14 11:15 鍙戣〃璇勮
]]>
Oracle OpenWorld 2013(Shanghai) -- Preview(鍘?http://www.aygfsteel.com/jiangshachina/archive/2013/05/28/399843.htmlSha JiangSha JiangTue, 28 May 2013 13:56:00 GMThttp://www.aygfsteel.com/jiangshachina/archive/2013/05/28/399843.htmlhttp://www.aygfsteel.com/jiangshachina/comments/399843.htmlhttp://www.aygfsteel.com/jiangshachina/archive/2013/05/28/399843.html#Feedback0http://www.aygfsteel.com/jiangshachina/comments/commentRss/399843.htmlhttp://www.aygfsteel.com/jiangshachina/services/trackbacks/399843.html
Oracle OpenWorld 2013(Shanghai) -- Preview
    Oracle OpenWorld 2013(涓浗)灝嗗湪涓冩湀鐨勪笂嫻蜂婦琛岋紝鏃ュ墠宸插彂甯冧簡鏄澶т細(xì)鐨勫悇涓?/span>涓撻璁插駭銆傛湰鏂囩畝浠嬩簡鑻ュ共鎴戜釜浜烘瘮杈冨叧娉ㄧ殑涓婚涓庤搴э紝甯屾湜鍏朵粬鏈嬪弸涔熻兘鎰熷叴瓚c?2013.06.06鏈鍚庢洿鏂?

    JavaOne hasn't been an independent event since Sun was required by Oracle, the software giant merged the conference with OpenWorld. As a Java developer, I concentrate more on JavaOne than OpenWorld, but I'm interested in some of OpenWorld sessions. I describe my favorite JavaOne and OpenWorld sessions respectively.

JavaOne
    As tradition, every time, there's a keynote or general session about Java present and future. So I think every attendee must focus on "KEY2215 - Java Strategy / Technical Keynote".
    JDK 6 has rest in peace, and its last update u45 was released last month. And after this February, Oracle will no longer post updates of Java SE 6 to its public download sites. So far, I never touch Java 7 in real world projects. Session "CON2227 - Why Should I Switch to Java SE 7?" may encourage me to switch to JDK 7.
    Java 8 is next major version, and it has delayed for a long time. In this April, Oracle announced this release is rescheduled again due to the guys shifted their focus to security problems@_@ Java 8 general available version will be issued in next March. And Lambda expression, which is known as the biggest update in Java language since Generics, will be introduced with the new distribution. Sessions "CON2224 - 55 New Features in Java SE 8" and "CON2241 - The Road to Lambda" will glance at the overview and new features of JDK 8.
    OAuth is "an open protocol to allow secure authorization in a simple and standard method from web, mobile and desktop applications". I ever developed an experimental desktop application for Sina Weibo, and the Weibo open API platform is using OAuth as its authorization interface. Session "CON1241 - OAuth 101: How to Protect Your Resources in a Web-Connected Environment" will introduce the basis of OAuth protocol and demonstrate how to use the authorization.
    I really concern application performance. How to profile program, how to find the bottleneck, and how to tune performance, all of them are my core focus. In session "CON1327 - Practical Performance: Understand the Performance of Your Application", an IBM guy will use JDK built-in tools (maybe VisualVM) to detect and troubleshoot the performance problems.
    In daily work, we need to process data in parallel, but I have to say our concurrent logics are pretty simple. However we still suffer from some troubles due to abusing, even worse, misunderstanding the concurrent utilities. Session "CON1250 - Implement a High-Level Parallel API in JDK" may inspire me in different approaches.

OpenWorld
    Compared with Oracle, I'm more familiar with MySQL, because it's much simpler. But I just work on MySQL simply: simple user management, simple performance tuning, simple data synchronization, simple backup and restoration, certainly, and simple installation and configuration in Linux environment. But...I have left MySQL for several years. How about the dolphin today? Session "CON1704 - MySQL: State of the Dolphin" may give me some answers, and I hope I could recall the days of playing the artifact.
    At present, NoSQL, Cloud, big data, ... are the hottest words, even though they aren't on my radar, it's necessary to know some basic conceptions on the fields. Therefore sessions "CON1445 - Oracle NoSQL Database and Oracle Database: A Perfect Fit", "CON1612 - Developing Java Applications in the Cloud: Oracle Java Cloud Service", "CON2303 - Big Data Overview and Oracle’s Big Data Solution", and "CON1476 - Implementing Big Data Solutions: From Theory to Practice" are accessible 101 lessons for me.
    OpenWorld gains more attention from Oracle, so it has more tracks. If I have enough time, and the agenda has no conflict, I'd like to listen to other topics, such as "CON1554 - What’s New for Java in the Latest Generation of Oracle Database Technology", "CON1452 - Advanced Database Performance Analysis with SQL Performance Analyzer", "CON1686 - Oracle Linux Strategy and Roadmap", ...

Sha Jiang 2013-05-28 21:56 鍙戣〃璇勮
]]>
Custom Layout Manager: PyramidLayout(鍘?http://www.aygfsteel.com/jiangshachina/archive/2012/07/15/383156.htmlSha JiangSha JiangSun, 15 Jul 2012 14:14:00 GMThttp://www.aygfsteel.com/jiangshachina/archive/2012/07/15/383156.htmlhttp://www.aygfsteel.com/jiangshachina/comments/383156.htmlhttp://www.aygfsteel.com/jiangshachina/archive/2012/07/15/383156.html#Feedback3http://www.aygfsteel.com/jiangshachina/comments/commentRss/383156.htmlhttp://www.aygfsteel.com/jiangshachina/services/trackbacks/383156.html
Custom Layout Manager: PyramidLayout
    宸叉湁澶鍏充簬鑷畾涔夐儴灞綆$悊鍣ㄧ殑鏂囩珷浜嗐傛湰鏂囦粎鏄竴綃囧涔?fàn)绗旇畮图屾弿杩颁簡濡備綍瀹炵庮C竴縐嶅儚鍫嗛噾瀛楀浼肩殑閮ㄥ眬綆$悊鍣紝寰堢畝鍗曪紝涔熸湁鐐瑰効鎰忔濓紝鍙兘浣犱篃浼?xì)鎰熷叴瓒g殑銆?2012.07.17鏈鍚庢洿鏂?   

    I have developed Swing application for several years, although I'm not professional GUI developer, I'm shamed of never creating any custom layout manager. Maybe the existing Swing layout managers are too powerful to create new ones. At least, GridBagLayout is powerful enough for my real works. And we have much more flexible GroupLayout and SpringLayout, of course, both of them are too complex, in fact I never use them directly. However I indirectly take advantage of GroupLayout due to using NetBeans' GUI designer Matisse.

1. Layout Manager basics
    Let's start with some layout manager foundation. Before this time I learn to customize layout, I always think layout manager is very mysterious. Layout is like a magic player that put a variety of components to right positions in containers. I haven't browsed any code of any layout, event the simplest one. That's why I think layout is mystery. But it's simple for me now.
    Generally, all of layout implements one or both of LayoutManager and LayoutManager2 interfaces. LayoutManager2 is LayoutManager's sub-interface, then if someone implements LayoutManager2 that means it really implements LayoutManager. Mostly all modern layouts implements LayoutManager2.
    Interface LayoutManager defines the basic methods must be implemented by every layout, all of them are intuitional: add new component--addLayoutComponent(); remove component--removeLayoutComponent(); calculate preferred size--preferredLayoutSize(); calculate minimum size--minimumLayoutSize(); how to layout the components--layoutContainer(). Absolutely, the layoutContainer() method is essential, you must instruct the parent container how to allocate space(bounds) for every component.
    The extension interface LayoutManager2 introduces more methods that if you have to: support constraints--addLayoutComponent(Component, Object); specify maximum size--maximumLayoutSize(); specify alignment--getLayoutAlignmentX() and getLayoutAlignmentY(); destroy specific caches or reset some variables when invaliding container--invalidateLayout().

2. PyramidLayout
    Now let's feature a simple and funny layout manager--PyramidLayout. The layout allows container to add components like building a Pyramid, as shown as the image below,

    As the above, PyramidLayout puts the first component on the bottom, then puts the second on top of the first, but its bounds is smaller, ... It looks like a Pyramid, doesn't it? Here is the full codes,
public class PyramidLayout implements LayoutManager2 {

    
private List<Component> comps = new LinkedList<Component>();

    
public void addLayoutComponent(final Component comp,
            
final Object constraints) {
        
synchronized (comp.getTreeLock()) {
            comps.add(comp);
        }
    }

    
public void addLayoutComponent(final String name, final Component comp) {
        addLayoutComponent(comp, null);
    }

    
public void removeLayoutComponent(final Component comp) {
        
synchronized (comp.getTreeLock()) {
            comps.remove(comp);
        }
    }

    
public float getLayoutAlignmentX(final Container target) {
        
return 0.5F;
    }

    
public float getLayoutAlignmentY(final Container target) {
        
return 0.5F;
    }

    
public void invalidateLayout(final Container target) {
        System.out.println();
    }

    
public Dimension preferredLayoutSize(final Container parent) {
        
synchronized (parent.getTreeLock()) {
            Insets insets = parent.getInsets();
            
int width = insets.left + insets.right;
            
int height = insets.top + insets.bottom;
            
if (comps.size() == 0) {
                
return new Dimension(width, height);
            }

            Dimension size = comps.get(0).getPreferredSize();
            width += size.width;
            height += size.height;

            
return new Dimension(width, height);
        }
    }

    
public Dimension minimumLayoutSize(final Container parent) {
        
synchronized (parent.getTreeLock()) {
            Insets insets = parent.getInsets();
            
int width = insets.left + insets.right;
            
int height = insets.top + insets.bottom;
            
if (comps.size() == 0) {
                
return new Dimension(width, height);
            }

            Dimension size = comps.get(0).getMinimumSize();
            width += size.width;
            height += size.height;

            
return new Dimension(width, height);
        }
    }

    
public Dimension maximumLayoutSize(final Container target) {
        
return new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE);
    }

    
public void layoutContainer(final Container parent) {
        
synchronized (parent.getTreeLock()) {
            Dimension parentSize = parent.getSize();
            
int compsCount = comps.size();
            Dimension step = new Dimension(parentSize.width / (2 * compsCount),
                    parentSize.height / (2 * compsCount));

            
for (int i = 0; i < compsCount; i++) {
                Component comp = comps.get(i);
                comp.setBounds(calcBounds(parentSize, step, i));
                parent.setComponentZOrder(comp, compsCount - i - 1);
            }
        }
    }

   
private Rectangle calcBounds(Dimension parentSize, Dimension step, int index) {
        
int x = step.width * index;
        
int y = step.height * index;
        
int width = parentSize.width - step.width * 2 * index;
        
int height = parentSize.height - step.height * 2 * index;
        
return new Rectangle(x, y, width, height);
    }
}
    Collection instance "comps" manages all of components, in this case, I take a LinkedList object to add and remove UI components. The layout doesn't concern any constraint, so the two addLayoutComponent() methods have the same actions. Please see the codes for details.
    As aforementioned, layoutContainer() method really takes charge of layouting the components. The key work is allocating space for each component, namely, specifying the bounds. Calculating bounds values just applies the simplest arithmetic operations.
    According to the intention, the bottom component fills the whole parent container, so it determines the preferred and the minimum sizes. For details, please take a look at methods preferredLayoutSize() and minimumLayoutSize(). Since the layout manager doesn't take care of the maximum size, the maximumLayoutSize() method simply returns a constant value.


Sha Jiang 2012-07-15 22:14 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 岳普湖县| 通许县| 长泰县| 台中县| 神池县| 道真| 磐安县| 四平市| 红安县| 克东县| 雅安市| 射阳县| 寿光市| 辰溪县| 德令哈市| 无极县| 门头沟区| 平湖市| 长海县| 卢湾区| 葫芦岛市| 二连浩特市| 湘潭市| 吉安县| 额济纳旗| 宝坻区| 巴塘县| 滕州市| 深泽县| 延长县| 邵武市| 安西县| 安福县| 嘉义市| 虎林市| 绵竹市| 成安县| 万荣县| 汝州市| 普定县| 米林县|