These are chat archives for django/django

2nd
Apr 2017
John Francis Marion
@jfmario
Apr 02 2017 02:44
im not clear on what specifically you're having trouble with, i have a general idea of what you are trying to do tho
Randolph Pe Benito
@randolphpebenito
Apr 02 2017 04:22
Hi
Quick question
Ace Of Spades
@codenoid
Apr 02 2017 04:33
hi all,
please give me some tutorial.
django with mongodb
Randolph Pe Benito
@randolphpebenito
Apr 02 2017 04:39
Hi @codenoid :)
Ace Of Spades
@codenoid
Apr 02 2017 04:41
heyy, @randolphpebenito
Randolph Pe Benito
@randolphpebenito
Apr 02 2017 04:43
are you new to Django?
or you have some basic skills already?
Ace Of Spades
@codenoid
Apr 02 2017 04:43
well, i can do print my name in django
Randolph Pe Benito
@randolphpebenito
Apr 02 2017 04:43
you have an idea on how to use pips?
Ace Of Spades
@codenoid
Apr 02 2017 04:44
its awesome, i mean, *look django print my name
Randolph Pe Benito
@randolphpebenito
Apr 02 2017 04:44
like import them?
how did you learn django? via videos or just reading stuff?
Ace Of Spades
@codenoid
Apr 02 2017 04:44
i can use it
virtualenv , et
etc
django templating
rounting,
and i want my django connected with 127017 aka my mongodb
Randolph Pe Benito
@randolphpebenito
Apr 02 2017 04:46
oh okay.
i see
i can't give you any specific tutorials about django and mongodb
but you can try to window shop here
that's not only limited to django mongodb
it has tons of stuff where you can cherry pick some libraries
for your django apps
:)
Brett MacDonald
@ArtistsTechGuy
Apr 02 2017 04:49
django doesn't natively support nosql dbs at this time, there is a fork . Most of what django is reputed for is it's ORM which translates between SQL and python. If you aren't using that you might be better off just learning flask or some other smaller framework.
@codenoid
Felipe Campelo
@fccampelo
Apr 02 2017 05:12
hello
how export data with django ?
How do I export project data djando to csv?
@fccampelo
Ace Of Spades
@codenoid
Apr 02 2017 05:18
thanks both @randolphpebenito @ArtistsTechGuy
Felipe Campelo
@fccampelo
Apr 02 2017 05:18
thanks
Ace Of Spades
@codenoid
Apr 02 2017 05:25
oh, and, i want try this awesome django app, but where my manage.py , and where the place to start runserver ? :( https://github.com/Fantomas42/django-blog-zinnia
Tushant Khatiwada
@Tushant
Apr 02 2017 05:56
Anyone online here?
Ace Of Spades
@codenoid
Apr 02 2017 05:56
me
Tushant Khatiwada
@Tushant
Apr 02 2017 05:57
I want help on DRF.
class ItemsAPIView(APIView):
    permission_classes = (permissions.IsAuthenticated,)
    pagination_class = api_settings.DEFAULT_PAGINATION_CLASS

    def get(self, request, format=None):
        """
        Return a list of all devices of this user.
        """
        reply = {}
        try:
            products = BaseItem.objects.owned_items().filter(owner=request.user)
            reply['data'] = OwnedItemSerializer(products, many=True).data

            items = BaseItem.objects.dev_items().filter(owner=request.user)
            reply['data'].extend(ItemSerializer(items, many=True).data)

        except:
            reply['data'] = []
        return Response(reply, status.HTTP_200_OK)
How can i use GenericAPIView instead of APIView based on this code?
you install this as an app after you install django
Tushant Khatiwada
@Tushant
Apr 02 2017 06:03
@ArtistsTechGuy Can you help me on my above question?
Brett MacDonald
@ArtistsTechGuy
Apr 02 2017 06:12
@Tushant I don't really have experience with DRF but it looks like GenericAPIView just extends APIView so replacing class ItemsAPIView(APIView): with class ItemsAPIView(GenericAPIView): may work or only need slight tweaking
Tushant Khatiwada
@Tushant
Apr 02 2017 06:19
@ArtistsTechGuy Thanks for your reply and Yes you are right. The problem is i have to use two serializer, one for owned_items and one for dev_items that is why i am having problem on how should i implement this condition in GenericAPIView
Brett MacDonald
@ArtistsTechGuy
Apr 02 2017 06:36
Anish Shrestha
@annshress
Apr 02 2017 07:00
anyone here familiar with postgres as django backend?
i want to implement searching in a postgres backend.
currently i am using trigram similarity for searching specific columns in the database. And I wanted to know if you guys have done anything that shows better results...
Furthermore, is there any way to provide weights to the Trigram Similarity annotations...
Theofanis Despoudis
@theodesp
Apr 02 2017 09:42
@annshress I would suggest to invest in elastic search for advanced searching
Its recommended and more advanced in terms of expression power for searching
Anish Shrestha
@annshress
Apr 02 2017 10:19
@theodesp Ok Theo.
Is there any starting point you want me to point to???
Theofanis Despoudis
@theodesp
Apr 02 2017 11:01
well the elastic search documentation for sure https://www.elastic.co/products/elasticsearch
then you need to interface django with elastic
maybe hooks
that does modular searching
Theofanis Despoudis
@theodesp
Apr 02 2017 11:07
but if you think is too much you can fall back to django using the new extensions https://docs.djangoproject.com/en/1.10/ref/contrib/postgres/search/
but i haven’t tested them
Anish Shrestha
@annshress
Apr 02 2017 16:13
Yes, using postgres search was abit limiting. I might go with Elastic search
thanks for info..
cs89gr
@cs89gr
Apr 02 2017 17:02
hello how to can get user id or user name in the views.py ?
Tushant Khatiwada
@Tushant
Apr 02 2017 17:10
request.user.id or request.user.username
cs89gr
@cs89gr
Apr 02 2017 17:18
like this ?test=Mymodel.objects.get(user=request.id) and i print test the i take id right ?
Ismael Venegas Castelló
@SalchiPapa
Apr 02 2017 17:19
test = User.objects.get(pk = 42)
You want the user or it's id?
MyModel has a foreign key to the user model?
cs89gr
@cs89gr
Apr 02 2017 17:23
i want to take user id or user username of login user where use that views.py code look my model
def generate_path(user):
    return "/{0}/img".format(user.username)

class MyModel(models.Model):
    user = models.ForeignKey(to=settings.AUTH_USER_MODEL)
    image = models.ImageField(upload_to=generate_path(self.user))
Tushant Khatiwada
@Tushant
Apr 02 2017 17:29
why to= is used? Should not it be User=?
cs89gr
@cs89gr
Apr 02 2017 17:32
i dont understand you
Ismael Venegas Castelló
@SalchiPapa
Apr 02 2017 17:34
I think he is trying to avoid a circular import
if he uses to
cs89gr
@cs89gr
Apr 02 2017 17:36
you mean upload_to ?
must be self.User ?
cs89gr
@cs89gr
Apr 02 2017 17:44
i have i simple upload function if i use this model in admin mode can i create user and add images and then in media create new folder with user id and image that from admin in the views.py must be define somewhere user id ?
Marios Panagopoulos
@MariosPanag
Apr 02 2017 17:45
guys can i ask one question familiar with python ?.
Anish Shrestha
@annshress
Apr 02 2017 17:48
image = models.ImageField(upload_to=generate_path(self.user))

should be

image = models.ImageField(upload_to=generate_path)

and

def generate_path(instance, filename):
  return "/{0}/img".format(instance.user.username)

Not tested. maybe this is what it should have been

Theofanis Despoudis
@theodesp
Apr 02 2017 17:59
@MariosPanag ok
Marios Panagopoulos
@MariosPanag
Apr 02 2017 18:01
I have a custom class A that is subclass of tuple. is there a way i can change the type of my A class instance into tuple instance ?
something like the upcast we do in java : (Animal) new Dog()
is this possible in python ?
Theofanis Despoudis
@theodesp
Apr 02 2017 18:04
xmm
this is usefull only with interfaces and interfaces do not exist in python
eveything is ducked typed
Marios Panagopoulos
@MariosPanag
Apr 02 2017 18:05
i will tell you why i wanna do that
so maybe you find a better solution
because i am newbie in python
i have 1 tuple and 1 instance of A class that is subclass of tuple and i want to compare them to see if they are equals
but the guy who wrote A class has changed the eq behavior so when i go to check if they are equals i get an exception
is there another way to compare these two ?
Theofanis Despoudis
@theodesp
Apr 02 2017 18:08
can you modify the A class?
Marios Panagopoulos
@MariosPanag
Apr 02 2017 18:09
no i cant modify his class
because it will affect other things
i want to compare the two tuples to see if they are equals
Theofanis Despoudis
@theodesp
Apr 02 2017 18:10
well the A class knows how to compare A classes then but if you write a comparator that knows how to compare A classes with your classes its better. You need to know what the A class checks
for example does it check for tuple values only?
Marios Panagopoulos
@MariosPanag
Apr 02 2017 18:12
he have implemented a very weird method
i dont know why he did that
i cant make a tuple instance made by the A class ?
and then compare 2 tuples ?
with their eq method ?
Ismael Venegas Castelló
@SalchiPapa
Apr 02 2017 18:13
It all depends on what does A.__eq__ does
Marios Panagopoulos
@MariosPanag
Apr 02 2017 18:14
def __eq__(self, other): return limit_versions(self, other, operator.eq)
```def limit_versions(language, limit, operator):
"""
Limits given languages with the given operator:
:param language:
    A `Language` instance.
:param limit:
    A number to limit the versions.
:param operator:
    The operator to use for the limiting.
:return:
    A new `Language` instance with limited versions.
:raises ValueError:
    If no version is left anymore.
"""
if isinstance(limit, int):
    versions = [version for version in language.versions
                if operator(int(version), limit)]
else:

    versions = [version for version in language.versions
                if operator(version, limit)]
if not versions:
    raise ValueError('No versions left')
return type(language)(*versions)```
Theofanis Despoudis
@theodesp
Apr 02 2017 18:14
Well do the same thing
Subclass your tuple and provide the same method and see what happens
Ismael Venegas Castelló
@SalchiPapa
Apr 02 2017 18:15
So he subclased tuples in order to implement versioning objects?
Marios Panagopoulos
@MariosPanag
Apr 02 2017 18:16
dont know this is what i see i am kinda newbie to fully undestand his reasons
Ismael Venegas Castelló
@SalchiPapa
Apr 02 2017 18:17
mmm, I would use your tuple and construct a new A with your provided tuple, and then compare those
how do you create an instance of calss A? See the A.__init__ method
Marios Panagopoulos
@MariosPanag
Apr 02 2017 18:18
the A class doesnt have an init method
``` def new(cls, items):
return tuple.new(cls, (Language[i] for i in items))
def __contains__(self, item):
    return any(item in lang for lang in self) ```
it has only these methods
Ismael Venegas Castelló
@SalchiPapa
Apr 02 2017 18:22
it is very weird, tuples dont have a new method
Is the code online? can you show it all?
Theofanis Despoudis
@theodesp
Apr 02 2017 18:23
what did the original author wanted to do with that tuples its confusing?
Marios Panagopoulos
@MariosPanag
Apr 02 2017 18:23
i can link you wait
Theofanis Despoudis
@theodesp
Apr 02 2017 18:23
did he supplied some tests?
or its ad-hoc?
Marios Panagopoulos
@MariosPanag
Apr 02 2017 18:24
I picked an issue to write tests for the Languages clas :P
Ismael Venegas Castelló
@SalchiPapa
Apr 02 2017 18:24
That's why I like composition more than inheritance in most cases, but in python it's the defacto
i want to write tests about the Languages class
this is where i am stuck
Ismael Venegas Castelló
@SalchiPapa
Apr 02 2017 18:26
ahh it's the markdown, that is loosing the _
Theofanis Despoudis
@theodesp
Apr 02 2017 18:26
this is serious metaclass hacking basically limit_versions accepts an operator and applies it to the tuple values
just like a filter but with the wrong name
Marios Panagopoulos
@MariosPanag
Apr 02 2017 18:28
is there something i can do to make my test correct?
Theofanis Despoudis
@theodesp
Apr 02 2017 18:29
a better name would be filter_versions
Basically versions are not tuple its just a list
Marios Panagopoulos
@MariosPanag
Apr 02 2017 18:33
ye but i have to make a test without modifying his class
so i have to make my tuple into Languages
or my Languages into tuple
how can i do that ?
to compare them ?
Akanksha
@aki2907
Apr 02 2017 18:33

def fizz_buzz(x):
for num in range(1, 21):
if num % 3 == 0:
print("Fizz")
elif num % 5 == 0:
print("Buzz")
elif (num % 3 == 0 and num % 5 == 0):
print("FizzBuzz")
else:
print(num)
pass

WHAT'S WRONG ABOVE?

Ismael Venegas Castelló
@SalchiPapa
Apr 02 2017 18:34
Then compare the tuple and the tuple inside Languages?
Theofanis Despoudis
@theodesp
Apr 02 2017 18:35
def __eq__(cls, other):
        return cls is not Language and cls() == other
Ismael Venegas Castelló
@SalchiPapa
Apr 02 2017 18:35
You are using assertTupleEqual(tuple, Language)
which is false
Theofanis Despoudis
@theodesp
Apr 02 2017 18:35
it looks like you do not need to provide a Language in order to do the comparisons
Ismael Venegas Castelló
@SalchiPapa
Apr 02 2017 18:35
try to reference the Language tuple
assertTupleEqual(tuple, Languages.tuple)
something like that
Marios Panagopoulos
@MariosPanag
Apr 02 2017 18:38
i dont know how to convert Languages into a tuple
Akanksha
@aki2907
Apr 02 2017 18:38
Hello... anyone plz help with my above query
Ismael Venegas Castelló
@SalchiPapa
Apr 02 2017 18:43
does tuple(Languages([...])) gives you a tuple?
Marios Panagopoulos
@MariosPanag
Apr 02 2017 18:45
tuple3 = tuple(Languages(['C#']))
TypeError: 'tuple' object is not callable
Ismael Venegas Castelló
@SalchiPapa
Apr 02 2017 18:45
>>> class Foo(tuple):
...     def __new__(self, items):
...         return tuple.__new__(self, (i*2 for i in items))
...
>>> f = Foo([1,2,3])
>>> f
(2, 4, 6)
>>> f == (2, 4 ,6)
True
>>> type(f)
<class '__main__.Foo'>
>>> type(tuple(f))
<type 'tuple'>
>>>
Theofanis Despoudis
@theodesp
Apr 02 2017 18:45
Language[‘C#’] is correct?
Marios Panagopoulos
@MariosPanag
Apr 02 2017 18:46
y = Language['C#']

print(type(y))

<class 'coalib.bearlib.languages.Language.C#'>

Ismael Venegas Castelló
@SalchiPapa
Apr 02 2017 18:47
you need to wrap code in triple backtics
```
>>> class Foo(tuple):
...     def __new__(self, items):
...         return tuple.__new__(self, (i*2 for i in items))
... 
>>> f = Foo([1,2,3])
>>> f
(2, 4, 6)
>>> f == (2, 4 ,6)
True
>>> type(f)
<class '__main__.Foo'>
>>> type(tuple(f))
<type 'tuple'>
>>>
```
like that ----^
Marios Panagopoulos
@MariosPanag
Apr 02 2017 18:50
tuple5 = tuple(Languages(['C#']))
TypeError: 'tuple' object is not callable
Ismael Venegas Castelló
@SalchiPapa
Apr 02 2017 18:51
let me install the lib
Marios Panagopoulos
@MariosPanag
Apr 02 2017 18:51
you are really kind
Ismael Venegas Castelló
@SalchiPapa
Apr 02 2017 19:02
>>> from coalib.bearlib.languages.Language import Languages
>>> L = Languages(['C#'])                                  
>>> L                                                      
(C#,)                                                      
>>> tuple(L)                                               
(C#,)
>>> type(L[0])
<class 'coalib.bearlib.languages.Language.C#'>
Do not use tuple as the name of the variable, just in case
Ismael Venegas Castelló
@SalchiPapa
Apr 02 2017 19:10
>>> from coalib.bearlib.languages.Language import Languages, Language
>>> items = ('C#', Language.Python == 3)
>>> items
('C#', Python 3.3, 3.4, 3.5, 3.6)
>>> tupl = (Language["C#"], Language["Python 3.3, 3.4, 3.5, 3.6"])
>>> tupl
(C#, Python 3.3, 3.4, 3.5, 3.6)
>>> items, tupl
(('C#', Python 3.3, 3.4, 3.5, 3.6), (C#, Python 3.3, 3.4, 3.5, 3.6))
>>> items == tupl
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\Ismael\Anaconda2\envs\py3\lib\site-packages\coalib\bearlib\languages\Language.py", line 381, in __eq__
    return limit_versions(self, other, operator.eq)
  File "C:\Users\Ismael\Anaconda2\envs\py3\lib\site-packages\coalib\bearlib\languages\Language.py", line 436, in limit_versions
    raise ValueError('No versions left')
ValueError: No versions left
ok Im getting the same error now @MariosPanag
Marios Panagopoulos
@MariosPanag
Apr 02 2017 19:10
yy :(
i tried your way as well
Ismael Venegas Castelló
@SalchiPapa
Apr 02 2017 19:10
notice that items and tupl are different
in items C# is a string "C#"
in tupl C# is a C# object
Marios Panagopoulos
@MariosPanag
Apr 02 2017 19:13
yeah
Ismael Venegas Castelló
@SalchiPapa
Apr 02 2017 19:13
>>> tupl = (Language["C#"], Language["Python 3.3, 3.4, 3.5, 3.6"])
>>> tupl
(C#, Python 3.3, 3.4, 3.5, 3.6)
>>> items
(C#, Python 3.3, 3.4, 3.5, 3.6)
>>>
Akanksha
@aki2907
Apr 02 2017 19:13
def fizz_buzz(x):
    for num in range(1, 21):
        if num % 3 == 0:
            print("Fizz")
        elif num % 5 == 0:
            print("Buzz")
        elif ((num % 3 == 0) and (num % 5 == 0)):
            print("FizzBuzz")
        else:
            print(num)
    pass
WHAT'S WRONG?
I am getting an error with 15
Ismael Venegas Castelló
@SalchiPapa
Apr 02 2017 19:15
> A new `Language` instance with limited versions.
> :raises ValueError:
the error comes from limit_versions
Marios Panagopoulos
@MariosPanag
Apr 02 2017 19:16
yeah because he has changed eq of Language class
Ismael Venegas Castelló
@SalchiPapa
Apr 02 2017 19:19
You have to create the C# object with versions like you did with Python
Marios Panagopoulos
@MariosPanag
Apr 02 2017 19:19
I didnt understand what you mea n
Ismael Venegas Castelló
@SalchiPapa
Apr 02 2017 19:26
@aki2907 you need to put elif ((num % 3 == 0) and (num % 5 == 0)): print("FizzBuzz") before the other if clauses
else the first test is true and it prints Fizz
Marios Panagopoulos
@MariosPanag
Apr 02 2017 19:27
@Ismael-VC even if we create two tuples when eq will run for the elements of the tuples it will fail
i cant understand what i must do
can i convert ?a Language instance into an Object?
can i convert <class 'coalib.bearlib.languages.Language.C#'> into an object and then call equals ?
equals of object ?
Ismael Venegas Castelló
@SalchiPapa
Apr 02 2017 19:30
>>> Language['C#'] == Language["C#"]
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\Ismael\Anaconda2\envs\py3\lib\site-packages\coalib\bearlib\languages\Language.py", line 381, in __eq__
    return limit_versions(self, other, operator.eq)
  File "C:\Users\Ismael\Anaconda2\envs\py3\lib\site-packages\coalib\bearlib\languages\Language.py", line 436, in limit_versions
    raise ValueError('No versions left')
ValueError: No versions left
that is the problem, not the tuples
>>> Language['Python'] == Language["Python"]
Python 2.7, 3.3, 3.4, 3.5, 3.6
Marios Panagopoulos
@MariosPanag
Apr 02 2017 19:31
yy so maybe we can change Language instances into Object and call Object's eq
is this possible ?
Ismael Venegas Castelló
@SalchiPapa
Apr 02 2017 19:31
It seems the problem is C# doesnt have any versions?
you want a hack? :suspect:
Marios Panagopoulos
@MariosPanag
Apr 02 2017 19:32
oh thats a hack ?
i am newbie i dont know :P
i just say ideas
Ismael Venegas Castelló
@SalchiPapa
Apr 02 2017 19:33
this is a hack! :P
>>> items = (Language['C#'], Language.Python == 3)                 
>>> tupl = (Language["C#"], Language["Python 3.3, 3.4, 3.5, 3.6"]) 
>>> items                                                          
(C#, Python 3.3, 3.4, 3.5, 3.6)                                    
>>> tupl                                                           
(C#, Python 3.3, 3.4, 3.5, 3.6)                                    
>>> str(items) == str(tupl)                                        
True
so tuple compares each object agains each object
when you compare the two tuples
first it tries to compare the two C#s
and that fails
why?
I'm not sure
Marios Panagopoulos
@MariosPanag
Apr 02 2017 19:34
so the problem is the elements of the tuple
Ismael Venegas Castelló
@SalchiPapa
Apr 02 2017 19:34
yes!
Marios Panagopoulos
@MariosPanag
Apr 02 2017 19:34
which are Language and the q gets invoked when we test equals on tuples
hmmmm
well the issue was difficult_low
ahahahaa
Ismael Venegas Castelló
@SalchiPapa
Apr 02 2017 19:35
when it tries to compare the C#s it uses the custom __eq__
Then it goes into limit_versions
inside it tests this:
    if not versions:
        raise ValueError('No versions left')
since C# doesnt have a version
>>> cs = Language["C#"] 
>>> cs.versions         
()
Marios Panagopoulos
@MariosPanag
Apr 02 2017 19:37
so i can test only those who have versions
Ismael Venegas Castelló
@SalchiPapa
Apr 02 2017 19:37
it fails like that
it seems so
Marios Panagopoulos
@MariosPanag
Apr 02 2017 19:38
yeap
i added versions = 2.7, 3.3, 3.4, 3.5, 3.6 in CSharp
and it passes the test
Ismael Venegas Castelló
@SalchiPapa
Apr 02 2017 19:40
:+1:
glad it works now
Marios Panagopoulos
@MariosPanag
Apr 02 2017 19:43
you've been very helpful ty :) by this process i learnt more :)
Ismael Venegas Castelló
@SalchiPapa
Apr 02 2017 19:44
Also it seems like a :beetle: to me, you should be able to compare languages even if they are versionless
That or create all Languages with a default version
just saying :D
Becasue Languages without version do exist in his program
Marios Panagopoulos
@MariosPanag
Apr 02 2017 19:45
yy only python has versions
Ismael Venegas Castelló
@SalchiPapa
Apr 02 2017 19:46
Language["Python"] works as is, because it has them, I'm sure C# should also have some versions by default there
You could open an issue
even if it's not a bug, documentation can be enhanced
Marios Panagopoulos
@MariosPanag
Apr 02 2017 19:46
yy true thats what i will do
and maybe i can write a test only for languages that have versions
and then when they change it
it will work for oithers too
Ismael Venegas Castelló
@SalchiPapa
Apr 02 2017 19:47
That seems like a good idea, go for it!
Marios Panagopoulos
@MariosPanag
Apr 02 2017 19:47
:") ty for help
its kinda hard cause i just started in programming
Ismael Venegas Castelló
@SalchiPapa
Apr 02 2017 19:48
IMHO if two language objects are the same kind of language and the have no versions, it should be True
the semantics are the ones that are tricky
Marios Panagopoulos
@MariosPanag
Apr 02 2017 19:49
true true
Ismael Venegas Castelló
@SalchiPapa
Apr 02 2017 19:49
If the author intended to change the semantics of __eq__ then he shouldn't have overloaded the == operator, but instead, add a new method in which he can do hat he wants
If it's a new object and you want to compare them, sure you can overload == but changing too much the semantics of such operators is bad idea
I guess he really really wanted to use x == y instead of x.method(y)
That's why I like the Julia language, you can create any op you want, no need for langauge developers to do it
Just recently python got @ for matrix multiply mainly
When people try to design Domain Specific Languages embedded in Python, they have to overtake the builtin operators, sometimes causing this confusion
@MariosPanag for just starting programming out, you have good understanding already, just keep doing it! :+1:
Marios Panagopoulos
@MariosPanag
Apr 02 2017 19:56
you are totally right :)
Theofanis Despoudis
@theodesp
Apr 02 2017 19:59
amazing
Totally Messed up
__eq__ that compares apples with oranges
Marios Panagopoulos
@MariosPanag
Apr 02 2017 20:01
ahahahaha
again thank you cause people in their chat kinda snob me and dont help out
and they create issues many t imes that dont make sense
Theofanis Despoudis
@theodesp
Apr 02 2017 20:04
it reminds me of scapy where you do something like
Ether()/IP()/TCP()
<Ether type=0x800 |<IP frag=0 proto=TCP |<TCP |>>>
Ismael Venegas Castelló
@SalchiPapa
Apr 02 2017 20:05
I'm reading coala/coalib/bearlib/languages/definitions/
Marios Panagopoulos
@MariosPanag
Apr 02 2017 20:05
i will open an issue and maybe my prof will be happy for me :P
Ismael Venegas Castelló
@SalchiPapa
Apr 02 2017 20:06
you are right, the other languages doesn't have a versions attribute, this is a bug, IMHO, you can fix it by providing versions to all languages, document that versions is requiered
Theofanis Despoudis
@theodesp
Apr 02 2017 20:06
tell your prof to give you a good project to work with, this gives you bad impressions about programming
Marios Panagopoulos
@MariosPanag
Apr 02 2017 20:07
true also :)
Ismael Venegas Castelló
@SalchiPapa
Apr 02 2017 20:07
or if versions is not supposed to be required, then make limit_versions, more lax and return True for same language, even if versionless
Tell your prof to give you Julia language as a project
:D
Very good community!
Julia has been in Google Summer of Code several years non stop now
Theofanis Despoudis
@theodesp
Apr 02 2017 20:10
is Julia suitable for scientific computing only?
Marios Panagopoulos
@MariosPanag
Apr 02 2017 20:11
I am afraid he doesnt allow us to change now i will do my best in this project then contiunue alone :)
Ismael Venegas Castelló
@SalchiPapa
Apr 02 2017 20:11
@theodesp it was designed with that in mind, but it is an great general purpose language
it just needs to reach v1.0 and the packages from its ecosystem also
v1.0 is expected this year
The scientific computing part is mainly because they want speed and be able to be expressive
but it has lisp like macros
an much more metaprogramming goodies
perfect for designing domain specific languages
Theofanis Despoudis
@theodesp
Apr 02 2017 20:13
to be honest I can only work with a small subset of languages. Im working with Scheme/Closure and possibly Haskell after that as my main focus is FP and I think they can do wonders
Ismael Venegas Castelló
@SalchiPapa
Apr 02 2017 20:13
with high level syntax like python, but high level performance like C
Theofanis Despoudis
@theodesp
Apr 02 2017 20:14
Maybe in the future I can play with Julia but not for now It hasn’t been on my radar
I’ve tried Rust but I got rusted back lol
Ismael Venegas Castelló
@SalchiPapa
Apr 02 2017 20:26
LOL
It came into my radar when I started to learn, the scientific stack of python
Now I can't wait to use Julia more and more, it has replaced shell scripts for me
and things like that
And of course I want to integrate it with Django! :D
Theofanis Despoudis
@theodesp
Apr 02 2017 20:51
ow my
juliango
:P
there is another one similar in go
Ismael Venegas Castelló
@SalchiPapa
Apr 02 2017 21:15
Djulia:P
Marios Panagopoulos
@MariosPanag
Apr 02 2017 21:22
@Ismael-VC ismael sorry for bothering you again but can you help me with git a bit ?
i had an opened pull request about and issue and now that i pushed my commit for anotyher issue it was connected with my previous pr how can i change this ?
Ismael Venegas Castelló
@SalchiPapa
Apr 02 2017 22:02
@MariosPanag you need to create the second PR in a separate branch
Marios Panagopoulos
@MariosPanag
Apr 02 2017 22:08
aha and what is the correct way to keep your repository updated from the main repository ?
Ismael Venegas Castelló
@SalchiPapa
Apr 02 2017 22:18
Could you list here the issues and pr you are working on?
Marios Panagopoulos
@MariosPanag
Apr 02 2017 22:19
i am asking generally whats the coorect workflow with git cause i am a bit confused
Ismael Venegas Castelló
@SalchiPapa
Apr 02 2017 22:19
It seems like you want to rebase your PR branch
On tip of current master
Oh I see
You want to read about the git flow
Marios Panagopoulos
@MariosPanag
Apr 02 2017 22:21
I dont know how to work correctly becuase
i was working on issue
and i refernced the issue in my commits
and then i rebased my commits
and the refernces stayed
Ismael Venegas Castelló
@SalchiPapa
Apr 02 2017 22:23
I cant find a page I wanted to link
:/
Yes number references are a GitHub thing
Not a Git thing
Marios Panagopoulos
@MariosPanag
Apr 02 2017 22:26
yy it looks kinda bad
cause it references commits i have deleted
didnt knew --amend when i did that :P
Ismael Venegas Castelló
@SalchiPapa
Apr 02 2017 22:35
Dont worry
Everybody messes up the first PRs
Nowadays you can use the github web interface for most of the git flow
Go to any repo
Try to edit a file. And github will create a fork and a branch for you automagically
Marios Panagopoulos
@MariosPanag
Apr 02 2017 22:38
i am worrying about what is the correct sequence of how to work
so i dont make useless commtis and merges
Ismael Venegas Castelló
@SalchiPapa
Apr 02 2017 22:47
Mark working PRs as WIP
Work In Progress
When you are ready to be reviewed
Change the title to
RFC
Request for Comments
ie
WIP: My first PR.
RFC: My first PR.
This is pretty common in github AFAICT
This way people dont get angry
And even if they do
Dint mind them
Dont be afraid to overwrite history
While you are learning
Marios Panagopoulos
@MariosPanag
Apr 02 2017 23:06
okey ty :)