Giter Site home page Giter Site logo

boolinq's People

Contributors

johnkarfill avatar k06a avatar

Watchers

 avatar

boolinq's Issues

how to convert from linq to boolinq

what is the equivalent commands in boolinq for the following linq statement?

System::Collections::Generic::IEnumerable ^lens = from ele in rules orderby 
ele::Support, ele::Confidence select ele; 
//sorting rules by support and then confidence

Original issue reported on code.google.com by [email protected] on 25 Jul 2012 at 4:28

Неявные преобразования способствуют ошибкам

1. Предположим, кто-нибудь создал функцию, и 
решил передать туда диапазон:

void foo(IterRange<int*> r);

...

int r[5] = {0,1,2,3,4};
foo(r);

2. Пока все хорошо. Но теперь этот кто-то 
решил развернуть массив:

int r[5] = {0,1,2,3,4};
foo(reverse(r));

3. Но что это? Ошибка компиляции! Надо 
изменить прототип функции:

void foo(ReverseRange<IterRange<int*> > r);

4. И снова все хорошо. Но представим теперь, 
что этот кто-то решил передать массив снова 
в прямом порядке:

int r[5] = {0,1,2,3,4};
foo(r); //WTF??

Но что это? Массив неявно развернулся!

----------------------

Для исключения подобных ошибок я предлагаю 
исключить неявные преобразования типов.

Original issue reported on code.google.com by [email protected] on 24 Apr 2012 at 11:00

Attachments:

Visual C++ 2012 cant compile min and max

What steps will reproduce the problem?
1. Include boolinq-all.h in a file and compile

Error report is Error C2027 use of undefined type of R.

If min an max and mixin's is removed and mixin's is removed from linq 
inheritance then all compiles. 

Original issue reported on code.google.com by [email protected] on 24 Sep 2012 at 7:26

Затруднительно передать диапазон в подпрограмму

Ситуация: требуется передать в 
подпрограмму диапазон, полученный заранее 
неизвестным образом.

Например, int r[5] = {0,1,2,3,4};
Требуется иметь возможность передавать в 
некоторую функцию как range(r), так и reverse(range(r))

В чем проблема? В том, что от способа 
получения диапазона зависит его тип. 
Потому на данный момент требуется все 
функции, принимающие диапазоны, делать 
шаблонными. Однако данный подход создает 
дополнительную проблему: требуется как-то 
указать компилятору, что в этом самом 
произвольном шаблоне лежит требуемый тип 
или же городить огород с приведениями 
типов.

Пример огорода:
template <typename R>
void foo(R r)
{
  if ((int)r.front() == 1) ...;
}

При этом в функцию может передан ТОЛЬКО 
диапазон над int (т.е. IterRange<int*>, 
ReverseRange<IterRange<int*> > и подобные), но 
компилятору об этом никто не сказал.

Поэтому я предлагаю ввести интерфейс, 
через который можно было бы обращаться к 
произвольным диапазонам независимо от 
способа его получения.

Например, так:

void foo(Linq<DynamicRange<int> > r);

...

int r[5] = {0,1,2,3,4};
foo(from(r).asDynamic());

(Здесь слово "dynamic" относится не к размеру 
диапазона, а к его фактическому типу)

PS десятой студии у меня нет, так что код в 
патче я не компилировал. Заранее извиняюсь, 
если там есть синтаксические ошибки.

Original issue reported on code.google.com by [email protected] on 24 Apr 2012 at 11:16

Attachments:

From doesn't work with vector of shared_ptr

What steps will reproduce the problem?
1. Create a class with a field of type vector<shared_ptr<Whatever>>
2. Try to use from() on it
3.

What is the expected output? What do you see instead?
I expect this to work. Instead compiler says no method from matches argument.

What version of the product are you using? On what operating system?


Please provide any additional information below.


Original issue reported on code.google.com by dmitrinesteruk on 28 Jun 2013 at 6:52

orderBy работает слишком медленно

В то время, как сортировка за время порядка 
N*log N уже стала нормой, boolinq предлагает 
сортировку, работающую медленнее 
пузырьковой!

Для "вытягивания" из OrderByRange каждого 
следующего элемента требуется заново 
перебрать все элементы исходной коллекции.

Сравните с Linq for Objects: там OrderBy вызывает ToList, 
сортирует получившийся список и просто 
отдает его. Почему нельзя сделать так же?

Original issue reported on code.google.com by [email protected] on 24 Apr 2012 at 10:51

orderBy would sometimes return an empty container

struct bar{int id,count;};

bar arr[]={{0,7},{1,5},{2,7},{3,2},{4,4},{5,3},{6,4},{7,5},{8,5},{9,5}};
std::vector<bar> out=boolinq::from(arr).orderBy([](const bar&ref){return 
ref.count;}).toVector();

printf(out.empty()?"WTF?\n":"OK.\n";);

Original issue reported on code.google.com by [email protected] on 24 Apr 2012 at 5:33

Attachments:

mingw

What steps will reproduce the problem?
1. dont't compile on mingw any version
2.
3.

What is the expected output? What do you see instead?


What version of the product are you using? On what operating system?
latest

Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 3 Apr 2013 at 9:18

Let's review this code!

First code review


Original issue reported on code.google.com by k06aaa on 4 Jan 2012 at 6:58

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.