Showing posts with label Программирование. Show all posts
Showing posts with label Программирование. Show all posts

Sunday, June 29, 2014

Java Combinatorics Library 2.1

Recently I have released a new version of the Java Combinatorics Library. This is a very simple library to generate permutations, combinations and other combinatorial sequences. You can read more about the library here. It can be downloaded manually from here or it can be used by maven from the central repository.

The previous major version of the library was released about 18 months ago in October 2012. It was downloaded more than 2170 times that is ~120 times per month and it is about 4 times per day!

According to the Google Analytics there were approx. 14 thousands sessions (visits) to the official library site. Each visit consisted of 2.49 pages in average, and took about 2 minutes 38 seconds.
  
Now I would like to share some statistics of the library audience after more than 18 months.


Here is a list of the top 10 countries where the library is the most popular according to the Google Analytics. Almost 25% of all audience comes from the United States of America. The second biggest audience is in India (14%), then in Germany (5%), in the United Kingdom (4%) and in Canada (4%).

Country Sessions Pages/Session Avg.Duration
1. United States 3445 2.38 2:29
2. India 1943 1.97 2:01
3. Germany 686 2.77 3:12
4. United Kingdom 563 3.05 3:05
5. Canada 501 2.29 2:36
6. Italy 419 3.02 3:49
7. Brazil 337 2.80 3:28
8. Ukraine 310 4.89 3:36
9. Poland 281 2.55 2:24
10. France 256 2.69 2:43
13978 2.49 2:38


Statistics By Regions

Almost 36% of the all site traffic comes from Europe. Germany is the main european visitor. There are three regions in Germany where the library is the most popular: Bavaria (130 sessions), North Rhine-Westphalia (112 sessions) and Baden-Wurttemberg (106 sessions). Among all european cities I would like to notice that Kyiv (210 sessions), London (187), Stockholm (123), Athens (118), Prague (101) and Rome (85) are the most active cities.

Europe - 35.73%
USA - 24.65%
The USA has almost 25% of all visitors. Among all the states I can highlight California (779 sessions), New York (348), Texas (192), Massachusetts (182) and Illinois (150). If we look at the statistics by the US cities, we will see the following result: New York (175), San Jose (104), San Francisco (82) and Austin (80).
Asia - 26.22%
Africa - 1.42%
Other big part of the sessions comes from Asia. It is about 26%. Here India is the main player: Bangalore (472 sessions), Chennai (327), Hyderabad (147), Pune (147) and New Delhi (114). Other big visitors from Asia are the Philippines (209), China (184) and Singapore (134).

South America brings approx. 5% of the all sessions, Oceania ~2.3% and Africa ~1.4%. In Africa the library is popular in South Africa (59) and in Egypt (48).


Age, Gender and Interest Categories

According to the Google Analytics almost 61% of the audience is the young people under the age of 34. Another interesting fact is that ~8.5% of the audience is interested in the sport activities such as running, walking or cycling. And only ~4% is interested in computers and electronics.


References to the library

The Library is used in the several open source projects such as SIMtester, IGCSA (in the Karyotype Insilico Genome Simulator Module), Archimulator, FASTLipid Project and Transmission Framework. It is used in research and development works like researching and optimization the heuristic facility location algorithms for the smart grid in North Dakota State University.

There were several questions regarding the combinatorics library on the stackoverflow.com (for example here and here) and sql.ru.  So I am glad to conclude that the library is useful!

Tuesday, February 2, 2010

Combinatoricslib: generating partitions

In number theory, a partition of a positive integer n is a way of writing n as a sum of positive integers. Two sums that differ only in the order of their summands are considered to be the same partition; if order matters then the sum becomes a composition. A summand in a partition is also called a part.

The partitions of 5 are listed below:
1 + 1 + 1 + 1 + 1
2 + 1 + 1 + 1
2 + 2 + 1
3 + 1 + 1
3 + 2
4 + 1
5

The number of partitions of n is given by the partition function p(n). In number theory, the partition function p(n) represents the number of possible partitions of a natural number n, which is to say the number of distinct (and order independent) ways of representing n as a sum of natural numbers.

This is a code:

// create partition generator of 5
Generator<Integer> partitionGenerator = new PartitionGenerator(5);

// create iterator
Iterator<CombinatoricsVector<Integer>> partitionIterator = partitionGenerator.createIterator();

partitionIterator.first();

// go through the iterator
while (!partitionIterator.isDone()) {
partitionIterator.next();
CombinatoricsVector<Integer> partition = partitionIterator.getCurrentItem();
System.out.println(partitionIterator);
}


And the result



PartitionIterator=[#1, CombinatoricsVector=[[1, 1, 1, 1, 1]], size=5]]
PartitionIterator=[#2, CombinatoricsVector=[[2, 1, 1, 1]], size=4]]
PartitionIterator=[#3, CombinatoricsVector=[[2, 2, 1]], size=3]]
PartitionIterator=[#4, CombinatoricsVector=[[3, 1, 1]], size=3]]
PartitionIterator=[#5, CombinatoricsVector=[[3, 2]], size=2]]
PartitionIterator=[#6, CombinatoricsVector=[[4, 1]], size=2]]
PartitionIterator=[#7, CombinatoricsVector=[[5]], size=1]]





Please read more here http://code.google.com/p/combinatoricslib/

Thursday, January 28, 2010

combinatoricslib: permutations with repetitions

The permutation may have more elements than slots. For example, the three possible permutation of 12 in three slots are: 111, 211, 121, 221, 112, 212, 122, and 222.

Please read more here http://code.google.com/p/combinatoricslib/


This is a code:


// create array of initial items
ArrayList<String> array = new ArrayList<String>();
array.add("one");
array.add("two");

// create combinatorics vector
CombinatoricsVector<String> corePermutation = new CombinatoricsVector<String>(array);

// create permutation with repetition generator, second parameter is a number of slots
Generator<String> permutationWithRepetitionGenerator = new PermutationWithRepetitionGenerator<String>(corePermutation, 3);

// create iterator
Iterator<CombinatoricsVector<String>> permutationWithRepetitionIterator = permutationWithRepetitionGenerator.createIterator();

// print the number of generated permutations
System.out.println("Number of permutationWithRepetition is: " + permutationWithRepetitionGenerator.getNumberOfGeneratedObjects());
permutationWithRepetitionIterator.first();

// go through the iterator
while (!permutationWithRepetitionIterator.isDone()) {
permutationWithRepetitionIterator.next();
CombinatoricsVector<String> permutationWithRepetition = permutationWithRepetitionIterator.getCurrentItem();
System.out.println(permutationWithRepetitionIterator);
}

And the result

Number of permutationWithRepetition is: 8
PermutationWithRepetitionIterator=[#1, CombinatoricsVector=[[one, one, one]],size=3]]
PermutationWithRepetitionIterator=[#2, CombinatoricsVector=[[two, one, one]],size=3]]
PermutationWithRepetitionIterator=[#3, CombinatoricsVector=[[one, two, one]],size=3]]
PermutationWithRepetitionIterator=[#4, CombinatoricsVector=[[two, two, one]],size=3]]
PermutationWithRepetitionIterator=[#5, CombinatoricsVector=[[one, one, two]],size=3]]
PermutationWithRepetitionIterator=[#6, CombinatoricsVector=[[two, one, two]],size=3]]
PermutationWithRepetitionIterator=[#7, CombinatoricsVector=[[one, two, two]],size=3]]
PermutationWithRepetitionIterator=[#8, CombinatoricsVector=[[two, two, two]],size=3]]

Tuesday, January 26, 2010

combinatoricslib: permutations without repetitions

I would like to introduce combinatoricslib. This is a library written on Java that contains various stuff to resolve different issues connected to combinatorics such as generating combinatorial objects and etc.

Today I am presenting permutations without repetitions. A permutation is an ordering of a set in the context of all possible orderings. For example, the set containing the first three digits, 123, has six permutations: 123, 132, 213, 231, 312, and 321.

This is a example of permutation of 3 string items: 

// create array of initial items
ArrayList<string> array = new ArrayList<string>();
array.add("one");
array.add("two");
array.add("three");

// create combinatorics vector
CombinatoricsVector<string> corePermutation = new CombinatoricsVector<string>(array);

// create permutation generator
Generator<string> generator = new PermutationGenerator<string>(corePermutation);

// print the number of generated permutations
System.out.println("Number of permutations is: " + gnerator.getNumberOfGeneratedObjects());

// create iterator
Iterator<combinatoricsvector<string>> iterator = generator.createIterator();
iterator.first();

// go through the iterator
while (!iterator.isDone()) {
iterator.next();
CombinatoricsVector<string> permutation = iterator.getCurrentItem();
System.out.println(permutation);
}


Output result is

Number of permutations is: 6
CombinatoricsVector=[[one, two, three]], size=3]
CombinatoricsVector=[[one, three, two]], size=3]
CombinatoricsVector=[[three, one, two]], size=3]
CombinatoricsVector=[[three, two, one]], size=3]
CombinatoricsVector=[[two, three, one]], size=3]
CombinatoricsVector=[[two, one, three]], size=3]

You can read more and download the library from here  

Thursday, February 28, 2008

DreamSpark

Microsoft DreamSpark enables students to download Microsoft developer and design tools at no charge.

Now, for the first time, Microsoft is giving its valuable software developer and design tools directly to students worldwide at no charge! This site enables students like you to download professional-level Microsoft developer and design tools to unlock your creative potential and set you on the path to academic and career success, by supporting and advancing your learning and skills through technical design, technology, math, science and engineering activities.

In order to get this software from Microsoft at no charge, you will be asked to establish or verify your student status once every 12 months. This process is built into this DreamSpark site itself. Verification of valid student status will enable students from around the globe to download Microsoft developer and design tools at no charge. Note: You must be at least 18 years old or have otherwise reached the age of majority in the place (province, state or country) where you live, or if not, your parent or legal guardian must accept the Microsoft DreamSpark software license terms on your behalf, in order for you to download and use the software.

It is our hope that the DreamSpark program will spark your creativity and help you harness software’s transformative magic to turn your good ideas into reality, by equipping you with the tools you need to succeed and excel during your academic experience and skills you will need after graduation.

https://downloads.channel8.msdn.com/
Microsoft дарит свой софт студентам

Thursday, September 27, 2007

Teach Yourself Programming in Ten Years

Сколько лет нужно потратить программисту, чтобы стать настоящим профессионалом? На этот вопрос дает ответ один из самых успешных программистов, который руководит исследованиями в одной из самых успешных компаний в Мире. Piter Norvig, Director of Research в компании Google в статье Teach Yourself Programming in Ten Years предлагает план действий для того, чтобы добиться успеха в программировании.
Кроме этого в статье представлены размышления о проблеме выбора языка программирования и некоторые рекомендации, касающиеся литературы.

Thursday, September 20, 2007

Ресурсы по Silverlight


Silverlight — это название новой технологии представления данных в Интернете, предназначенной для запуска на различных платформах. Она позволяет создавать насыщенные, визуально привлекательные веб-страницы, работающие в различных обозревателях, устройствах и настольных операционных системах (например Apple Macintosh). Ключом к возможностям Silverlight, как и ко всей технологии представления WPF (Windows Presentation Foundation) платформы Microsoft .NET Framework 3.0, является XAML (eXtensible Application Markup Language, расширяемый язык разметки приложений).

Перечень интересных материалов по этой теме: