Monday, September 30, 2013

How clone method works in Java

clone is a tricky method from java.lang.Object class, which is used to create copy of an Object in Java. Intention of clone() method is simple, to provide a cloning mechanism, but some how it's implementation became tricky and has been widely criticized from long time. Anyway, we will not go to classic debate of clone in Java, at-least for now; instead, we will try to learn how clone method works in Java. To be fair, understating cloning mechanism in Java is not easy and even experienced Java programmer fail to explain how cloning of mutable object works, or difference between deep copy and shallow copy in Java. In this three part article, we will first see working of clone method in Java, and in second part we will learn how to override clone method in Java, and finally we will discuss deep copy vs shallow copy mechanism. The reason I chose to make this a three part article, is to keep focus on one thing at a time. Since clone() itself is confusing enough, it's best to understand concept one by one. In this post, we will learn what is clone method, what it does and How clone method works in Java. By the way, clone() is one of the few fundamental methods defined by objects, others being equals, hashcode(), toString() along with wait and notify methods.
Read more �

Sunday, September 29, 2013

Validity of Nanotyrannus

Hi all.  It's been a while, but I've been finishing the Lori matrix and earning money.  This post is based on Carr's excellent Tyrannosauroidea blog, which will be added to my blogroll once I update it.  Carr wrote a post arguing Nanotyrannus are juvenile Tyrannosaurus, and while I provisionally agree with this, I felt his reasons were partly flawed and that any modern defender of the genus wouldn't be convinced.  Arguing as Devil's Advocate, I commented about this, and Carr has since replied.  As my own reply to that is so long, I felt I would post it here and link here from his blog.  The points are numbered to correspond to Carr's, though this is rather messy as some points are made in multiple places.  Enjoy.

Thanks for the detailed reply, Tom!  As with before, I write as Devil's Advocate, as I do provisionally agree with you Nanotyrannus are juvenile Tyrannosaurus.  That said, it seems we do actually have some philosophical differences.

#1/#6- You seem to have a double standard here.  For Nanotyrannus you write "Instead, they have just heaped on new characters as if that�ll do the job of rescuing the taxon" but for Tyrannosaurus you say "there is no reason to think that T. rex is invalid, given the quality of specimens (including the type) and sample size that has been amassed. Certainly, the time has come to bring the diagnoses for T. rex and many other taxa up to date..."  So we can heap on new characters for Tyrannosaurus, but not for Nanotyrannus?  What's ironic here is that Bakker et al.'s (1988) diagnosis was itself heaping on new/all characters to the original diagnosis of lancensis by Gilmore (1946).  That original diagnosis was completely stratigraphic, as Gilmore viewed the few differences he saw between lancensis and sternbergi as potentially individual variation.  Thus he wrote "in view of the great interval of time that has elapsed between Belly River and Lance, one appears justified in believing that it is too great a span in time for a species to pass unchanged from one to the other, and that with the discovery of additional materials characters will eventually be found that will adequately distinguish them."

"In my mind, there is no reason not to accept the diagnosis of Nanotyrannus (or any other taxon) as, prima facie, the best argument for establishing a scientific name."  The reason is that diagnoses are a product of their time, both in the sense of less material being known and available, and the philosophy being outdated.  Original diagnoses are often terrible for this reason, though the taxa are still valid.

In my view, an original diagnosis is just a starting point for assessing validity.  If it fails, you then check subsequently suggested diagnostic characters.  If that fails, you then look yourself for unpublished diagnostic characters.  If that fails, synonymy or indeterminacy is reasonable.

#1/#2/#3- Now you do have a point that if Jane were diagnostic but the Cleveland skull were not, then Jane could not easily be called Nanotyrannus lancensis.  But this isn't true of all of the characters suggested by Larson.  According to him, the Cleveland skull has a large number of maxillary teeth, strongly labiolingually compressed lateral teeth, a narrow vomer, posteriorly located maxillary fenestra, shallow antorbital fossa, posterodorsal quadratojugal notch, subnarial foramen enclosed by maxilla, quadratojugal foramen, and dorsally opening jugal foramen.  Now I agree with you that most of these are ontogenetic (though even younger Tarbosaurus MPC-D 107/7 lacks the high maxillary tooth count, enclosed subnarial foramen, pneumatic quadratojugal and jugal foramen orientation, so on the surface those look potentially valid), but you can't write off new Nanotyrannus diagnoses as being only based on Jane.  And given that the Cleveland skull and Jane share some apparent apomorphies, it's perfectly valid to use the additional apparent apomorphies from Jane to support Nanotyrannus.

#X- I understand your not wanting to discuss Larson's (2013) proposed Nanotyrannus characters or those only preserved in Jane, due to your work on those topics being in prep..  In a sense, that stalls the issue on your blog for now and makes it so we really can't have a good modern defense of synonymy. 

But there is one character we can tackle, preserved in the Cleveland skull and presented as an autapomorphy prior to Larson's work- the high maxillary and dentary tooth count.  You say "I did propose a hypothesis to account for the difference in tooth count (Carr, 1999)" and that's true- that libratus and some modern crocodilians also show a reduction.  But since then Currie (2003- fig. 5) have graphed out both libratus and Tarbosaurus to show no decrease, and Tsuihiji et al.'s (2011) new tiny Tarbosaurus has an adult count too.  As a stable or increasing count is also seen in Coelophysis, Ceratosaurus, Majungasaurus and therizinosauroids, this makes the apparent condition in crocodilians irrelevent and argues against your hypothesis.  It's always possible Tyrannosaurus was unusual among theropods in reducing tooth count with age, or that the Cleveland skull is an outlier independent of age (though Jane strains the probability of this), but either rationale is ad hoc instead of fitting with expected trends.  This was always the strongest pre-Jane argument for Nanotyrannus in my opinion, and it remains so.  If the toothy Alioramus are Tarbosaurus, this would give some precedent (for the jugal foramen orientation too), but see below for that.

#4- "In the table I present (implicitly) the hypothesis that Daspletosaurus is peramorphic relative to A. libratus, in that the growth trends are carried further in the tyrannosaurine. That is why Daspletosaurus is under the heading �Stage 4�."  But in 1996, you explicitly said- "Four ontogenetic stages are defined ...  These morphotypes have been misinterpreted by previous workers as distinct taxa. Daspletosaurus torosus ... are found to be invalid taxa, representing the adult morphotype of Albertosaurus libratus ...".  So Daspletosaurus was explicitly thought to be a a stage 4 Albertosaurus by you at first, based on these stages.  Like I said, you changed your mind by 1998, but this indicates the list/table itself is not capable of distinguishing ontogeny from peadomorphy/peramorphy. 

"The salient point you make is the suggestion that the Cleveland skull is an adult, but it does not grow past stage 1. I think it is reasonable to expect that an adult of a true �pygmy� tyrannosaurid would have all of the adult characters seen in its closest relatives."
Wouldn't a paedomorphic taxon by definition not have all of the adult characters seen in its closest relatives?  More importantly for our actual argument, you showed the Cleveland skull has juvenile bone grain.  This seals the deal on its age for me, so I agree with you its a juvenile regardless of any other ontogenetically variable characters.  Unless paedomorphic vertebrates can have juvenile bone grain?  Does that happen?

#5- "With regard to Bakker et al.�s (1988) tyrannosaurid phylogeny, I do think that context matters. Their arrangement complements what they say in the text, together showing the deductions that led to their taxonomic decision. It is an excellent article in that the data are absolutely clear."  Not really important to our debate, but this further illustrates a difference in our philosophy.  Put basically, if a taxon is conceived in an inaccurate context (be it diagnosis or phylogenetic hypothesis), it's invalid.

#7- So put less obscurely, you disagree with your coauthors and think Alioramus is a juvenile Tarbosaurus?

#8- "Yes, it is fair because sufficient data was at hand (e.g., Rozhdestvensky, 1965), and there were two growth series (A. libratus, T. bataar) available with which to make comparisons."  Harsh, as the libratus sample in 1988 didn't get younger than "sternbergi".  But again, not a very useful point of contention.

#10- "That�s a good point! I have to admit that I was late on the scene as well (Carr and Williamson, 2004)."  In your defense, by 1999 the specimen was viewed as either a new species megagracilis, or an entire new genus Dinotyrannus.  Bakker et al. didn't have that excuse in 1988.

#11- "The bottom line is that the relative maturity of specimens and their taxonomic identity must be considered separately..."
Er, that seems contrary to your main philosophy and methodology, and of science basically.  You established an ontogenetic series in libratus, then compared Nanotyrannus and Maleevosaurus to that to go a long way to determining their age.  You also found striations and unfused bones in Nanotyrannus, but the importance of these also depend on their variation in other specimens with known age.
If Nanotyrannus were magically proven to be an adult, for instance, your whole argument for Maleevosaurus being a juvenile Tarbosaurus would collapse.  All of the juvenile libratus characters present in Maleevosaurus would also be present in adult Nanotyrannus, so Maleevosaurus could be an adult as well.  I don't think this situation is true (barring juvenile bone grain existing in paedomorphic adults), but philosophically it seems valid.

"Williamson and I (2004) showed that �Stygivenator� is referable to T. rex, but Larson (2013) did not engage with the evidence that we presented."
This is a good example.  IF Nanotyrannus is valid and sister to Tyrannosaurus, then the Tyrannosaurus-like characters you identified in "Stygivenator" don't mean it is Tyrannosaurus, because Nanotyrannus also has them.  They would only go as far to show "Stygivenator" was in the Nanotyrannus-Tyrannosaurus group.  Since Larson already believes this, he doesn't need to engage with them.

#Y- You say "it is curious that people are a lot less upset about my hypothesis that Maleevosaurus is a juvenile T. bataar".  I think it's just that less people have bothered with it.  You (1996, 1999) used Maleev's figures to argue the supposed cranial apomorphies were juvenile characters, but no one's even addressed Carpenter's (1992) postcranial characters (tall cervical neural spines; reduced acromion on scapula; pronounced spur-like obturator process; downcurved ischium; and metatarsals III and IV don't overlap the metatarsals medial to them much), adult characters (closed neurocentral sutures and fused astragalocalcaneum) or examined the specimen themselves since Maleev's work AFAIK.

References- Gilmore, 1946. A new carnivorous dinosaur from the Lance Formation of Montana. Smithsonian Miscellaneous Collections. 106, 1-19.

Bakker, Williams and Currie, 1988. Nanotyrannus, a new genus of pygmy tyrannosaur, from the latest Cretaceous of Montana. Hunteria. 1, 1-30.

Carpenter, 1992. Tyrannosaurids (Dinosauria) of Asia and North America. in Mateer and Chen (eds.). Aspects of nonmarine Cretaceous geology. Beijing, China. Ocean Press. 250-268. 

Carr, 1996. Cranial osteology and craniofacial ontogeny of Tyrannosauridae (Dinosauria: Theropoda) from the Dinosaur Park Formation (Judith River Group, Upper Cretaceous: Campanian) of Alberta. Masters Thesis. University of Toronto. 358 pp.

Carr, 1999. Craniofacial ontogeny in Tyrannosauridae (Dinosauria, Coelurosauria). Journal of Vertebrate Paleontology. 19, 497-520.

Currie, 2003. Cranial anatomy of tyrannosaurid dinosaurs from the Late Cretaceous of Alberta, Canada. Acta Palaeontologica Polonica. 48(2), 191-226. 

Tsuihiji, Watabe, Tsogtbaatar, Tsubamoto, Barsbold, Suzuki, Lee, Ridgely, Kawahara and Witmer, 2011. Cranial osteology of a juvenile specimen of Tarbosaurus bataar (Theropoda, Tyrannosauridae) from the Nemegt Formation (Upper Cretaceous) of Bugin Tsav, Mongolia. Journal of Vertebrate Paleontology. 31(3), 497-517.

Larson, 2013. The case for Nanotyrannus. in  Parrish, Molnar, Currie and Koppelhus (eds.). Tyrannosaurid Paleobiology. Indiana University Press. 15-54.

Wednesday, September 25, 2013

SQLSaturday #232 Orlando - The case of the pesky projector



On Saturday, September 14, 2013, I presented my session "Cure your sysadmin addiction" at SQL Saturday #232 in Orlando at Seminole State College



I can prove it. I have pictures. 



On the left, I'm wearing my speaker shirt "Bubba-style". 













The best #SQLSat232 tweet was...










































My session was right after lunch and the speaker group picture so I had to hurry to my session at 2 PM



Once again, getting the projector to play nice with my laptop proved to be difficult.



I could not get PowerPoint Presenter View to work correctly.  



Running Windows 8 as a guest OS in VirtualBox on a Ubuntu Linux 12.04 LTS host should not be this difficult.  Should it?



Why does this always happens when Rob Volk is in the room?









That's Rob on the right.


























I did test my setup prior to my talk.  It worked at home.  Here's proof.  

Believe me now Mr. Dunagan?  ;-)







































I think I need to run the Guest OS in Fullscreen mode for it to work correctly.

It might have been a resolution issue also. Adjusting the resolution I'm sending to the projector may have helped. I'll keep that in mind next time.



Despite the issues with the projector, I did get through my entire presentation and still had time to answer questions along the way.  It was my third time presenting this session so I was pretty pleased I remembered most of my notes.



If you need another good reason to manage sysadmin strictly, consider this.



Another great job by Karla Landrum, Kendal Van Dyke and the team in Orlando.  Seminole State College is one of the best SQL Saturday venues. Keller's BBQ provided a great lunch again with the speakers serving up the goodies. I'm glad the speaker shirts were the standard polo.  I can wear it to work although I could be mistaken for a Florida Gators or Clemson Tigers fan.



I'll get a chance to do my talk again at the Tampa SQL User group meeting at the end of this month.  Hopefully, I can get the pesky projector working.


Tuesday, September 24, 2013

JSTL forTokens Tag Example - Split String in JSP

JSTL forTokens tag is another tag in core JSTL library to support Iteration or looping. It effectively complements, more useful <c:forEach> tag, by allowing you to iterate over comma separated or any delimited String. You can use this tag to split string in JSP and can operate on them individually. forTokens tag has similar attribute like forEach JSTL tag except one more attribute called delims, which specifies delimiter. For example to iterate over colon separated String "abc:cde:fgh:ijk", delims=":". By the way, forTokens tag also accept multiple delimiter, which means, you can split a big string into token based upon multiple delimiter e.g. colon(:) and pipe (|), This will be more clear, when we will see examples of JSTL forTokens tag in JSP. Rest of attribute e.g. items, var, varStatus, begin, end and step are same, as they are in case of <c:forEach> tag. For quick review, items specify String which needs to be split-ed in token and var hold current String.
Read more �

Sunday, September 22, 2013

تبديل زر ابدأ في الويندوز 8.1 بالصورة التي تريدها


windows 8.1 Start Button Changer.

 هو برنامج سيمكنك ان شاء الله من تبديل زر ابدأ الى اشكال اخرى انت تختارها ، بالطبع البرنامج مجاني .
ملاحظة ، هذا البرناج يشتغل فقط على الويندوز 8.1 .

كيفية الاستعمال :

حمل البرنامج من هنا ، ثم قم بتشغيله " لا يحتاج الى التثبيت"


اضغط على زر التبديل CHANGE



تصفح و افتح الصورة التي تريدها ان تظهر زر جديد لابدأ ، لا تقلق البرنامج سيقوم تلقائيا من تغيير شكل الصورة حتى تدخل كزر لابدأ .


اذا اردت تحميل وتثبيت الويندوز 8.1 مجانا ، جميع المراحل موجودة هنا ، اضغط هنا .


مواضيع ستهمك ايضا :

الدرس 59: جرب الويندوز 8 اون لاين ومجانا

Wednesday, September 4, 2013

SQL Saturday #232 Orlando - I'm speaking!







I'll be speaking at SQL Saturday #232 in Orlando, FL on Saturday, September 14, 2013.



The information for this always outstanding event can be found here.



I will be presenting "Cure your sysadmin addiction".  If you have the requirement to reduce DBA permissions in your Production environment due to Risk and Compliance mandates, you should attend. 



This will be my third time speaking in Orlando and my eleventh SQL Saturday overall.



SQL Saturdays are an extremely inexpensive way for IT Pros to gain an edge in a competitive job market and to develop a network that can help you at your current job or find that next job.



Get an edge, attend!






PASS Security Virtual Chapter webinar - Cure Your Sysadmin Addiction






I had the pleasure of presenting for the new PASS Security Virtual Chapter on August 29, 2013.  



My presentation  "Cure your sysadmin addiction" describes the fundamentals of Separation of Duties, reviews SQL Server fixed server roles and granular permissions and the steps I took to reduce DBA permissions in our Production environments to satisfy a mandate from the management and our IT Risk and Compliance group.



If you missed it, the session was recorded. 

Please forgive the audio difficulties at the beginning. Once I dialed into the session, it went smoothly.



Thank you to K. Brian Kelley, Argenis Fernandez, and Robert Davis for the opportunity.


Tuesday, September 3, 2013

How Maven find dependency JARs while building Java Project

One of the most attractive feature of Apache Maven framework it to manage dependency JARs, but do you know, How Maven finds dependency JAR while building Java project? From where does it download all JAR files? How does Maven search for a particular dependency? In fact, these are some of the frequently asked questions by Maven beginners. Many Java programmer started using Maven as build tool, because of it's dependency management advantages. Since almost all Java project uses lot's of open source libraries, which means adding multiple JAR into classpath. In fact, this dependency on JAR file is one of the most time consuming part of setting up a Java project in Eclipse. Maven comes in picture, and allows you to just declare dependency in pom.xml file, rest will be taken care by Maven. In this article, we will take a closer look on How Maven manages dependencies and How does it finds respective JAR files during build process.
Read more �