how to convert a data.frame to tree structure object such as dendrogram

how to convert a data.frame to tree structure object such as dendrogram

I have a data.frame object. For a simple example:> data.frame(x=c('A','A','B','B','B'), y=c('Ab','Ac','Ba', 'Ba','Bd'), z=c('Abb','Acc','Bad', 'Bae','Bdd')) x y z1 A Ab Abb2 A Ac Acc3 B Ba Bad4 B Ba Bae5 B Bd Bddthere are

What's a good way to collect logs from Amazon EC2 instances?

What's a good way to collect logs from Amazon EC2 instances?

My app is hosted on an Amazon EC2 cluster. Each instance writes events to log files. I need to collect (and data mine) over these logs at the end of each day. What's a recommended way to collect these logs in a central location? I have thou

Can C# generics have a specific base type?

Can C# generics have a specific base type?

Is it possible for a generic interface's type to be based on a specific parent class?For example:public interface IGenericFace{}Obviously the above code doesn't work but if it did, what I'm trying to tell the compiler is that T must be a su

What is CoNLL data format?

What is CoNLL data format?

I am new to text mining. I am using a open source jar (Mate Parser) which gives me output in a CoNLL 2009 format after dependency parsing. I want to use the dependency parsing results for Information Extraction. But i am able to understand

How can Inheritance be modelled using C? [duplicate]

How can Inheritance be modelled using C? [duplicate]

This question already has an answer here: Object-orientation in C 18 answers Is it possible to model inheritance using C? How? Sample code will help.Ed

Trouble understanding the whole OSGi web eco system

Trouble understanding the whole OSGi web eco system

I am pretty new to the whole Java and OSGi world and I have trouble understanding the eco system of a OSGi web application.To be more precise I am at the moment trying to understand how all the parts of the eco system are related to each ot

How to get array keys in Javascript?

How to get array keys in Javascript?

I have an array created with this code:var widthRange = new Array();widthRange[46] = { min:0, max:52 };widthRange[66] = { min:52, max:70 };widthRange[90] = { min:70, max:94 };I want to get each of the values 46, 66, 90 in a loop. I tried f

Custom layout for different cell sizes in UICollectionView

Custom layout for different cell sizes in UICollectionView

I would like to use the new UICollectionView, but I'm not sure if it is possible to build the following:As you can see, there are two different cell types. One is portrait, one is landscape. When I use the flow layout, it always creates row

Is there a Generic python library to consume REST based services? [closed]

Is there a Generic python library to consume REST based services? [closed]

Ok. I want to consume REST based services. I'd like to use python. In fact, I am going to use python.The way I'd like to use it is from the command line/ipython, to try out different REST services, with intention of formally coding it lat

Bloomberg API request limit

Bloomberg API request limit

Is there anyway to determine how many requests or how much data you have in your remaining request limit amount for Bloomberg API? 1:Bloomberg do not state what the explicit limits are, and there is no programmatic way of finding out wha

How to use RWMutex in Golang?

How to use RWMutex in Golang?

type Stat struct { counters map[string]*int64 countersLock sync.RWMutex averages map[string]*int64 averagesLock sync.RWMutex}It is called belowfunc (s *Stat) Count(name string) { s.countersLock.RLock() counter := s

How to create Encryption Key for Encryption Algorithms?

How to create Encryption Key for Encryption Algorithms?

I want to use encryption algorithm available in .Net Security namespace, however I am trying to understand how to generate the key, for example AES algorithm needs 256 bits, that 16 bytes key, and some initialization vector, which is also f

Using *just* Bootstrap modal

Using *just* Bootstrap modal

I'm integrating my Modal from Bootstrap with another site that doesn't use it.I see that bootstrap lets you separate the Javascript for each component. But what about the CSS? If I link to bootstrap.css the whole site will change. I just

How to kill/stop a long SQL query immediately?

How to kill/stop a long SQL query immediately?

I am using SQL server 2008 and its management studio. I executed a query that yields many rows. I tried to cancel it via the red cancel button, but it has not stopped for the past 10 minutes. It usually stops within 3 minutes. What could th

Determine if a Class implements a interface in Java

Determine if a Class implements a interface in Java

I have a Class object. I want to determine if the type that the Class object represents implements a specific interface. I was wondering how this could be achieved?I have the following code. Basically what it does is gets an array of all th

Dynamically add version number to dest output files w/ grunt

Dynamically add version number to dest output files w/ grunt

I have a package.json file with our version number, such as:{ name: "myproject" version: "2.0"}My goal is to dynamically add the version number from the package.json file into the output files. For example, in the javascript I don't w

rails link_to :remote

rails link_to :remote

I have the following: 'Are you sure?', 'data-severity' => 'danger', :remote => true do %> which brings up a Bootstrap Modal for confirmation, and I wanted to hook onto the ajax call that so that I can display a spinner or some kind of text

Precise Drag and Drop within a contenteditable

Precise Drag and Drop within a contenteditable

The SetupSo, I have a contenteditable div -- I'm making a WYSIWYG editor: bold, italics, formatting, whatever, and most lately: inserting fancy images (in a fancy box, with a caption). Optional Caption goes Here!The user adds these f

Is this a web page or an image?

Is this a web page or an image?

http://lcamtuf.coredump.cx/squirrel/According to the author, This is an embedded landing page for an image. You can link to this URL and get the HTML document you are viewing right now (soon to include essential squirrel facts); or embe

Difference between a factory, provider and a service?

Difference between a factory, provider and a service?

What is the difference between the terms factory, provider and service?Just getting into nhibernate and its repository pattern (POCO classes, etc). 1:Factory: Assembles classes, either by composing a bunch of bits together, or choosing t

How to using ReactiveCocoa to transparently authenticate before making API calls?

How to using ReactiveCocoa to transparently authenticate before making API calls?

I am using ReactiveCocoa in an app which makes calls to remote web APIs. But before any thing can be retrieved from a given API host, the app must provide the user's credentials and retrieve an API token, which is then used to sign subseque

Git refuses to reset/discard files

Git refuses to reset/discard files

I have a project with certain js files which I cannot update. I run OSX locally and my remote/staging server is Linux (CentOS).Right after cloning my project locally, i noticed I have all those files with git status modified. I never modifi

rsync exclude according to .gitignore & .hgignore & svn:ignore like --filter=:C

rsync exclude according to .gitignore & .hgignore & svn:ignore like --filter=:C

Rsync includes a nifty option --cvs-exclude to “ignore files in the same way CVS does”, but CVS has been obsolete for years. Is there any way to make it also exclude files which would be ignored by modern version control systems (Git, Mercu

What is the role of glBindVertexArrays vs glBindBuffer and what is their relationship?

What is the role of glBindVertexArrays vs glBindBuffer and what is their relationship?

I'm new to OpenGL and Graphics Programming. I've been reading a textbook which has been really thorough and well-written so far.However, I've hit a point in the code that I'm not quite understanding and I'd like to make sense of these lines

How do I run only specific tests in Rspec?

How do I run only specific tests in Rspec?

I think there's a way to run only tests with a given label. Anybody know? 1:It isn't easy to find the documentation, but you can tag examples with a hash. Eg.# spec/my_spec.rbdescribe SomeContext do it "won't run this" do raise "neve