« first day (3298 days earlier)      last day (1633 days later) » 

3:17 AM
cbg
Anyone know how to use django to manage my website home page? I know how to register a model, but it's just show a list, and then I can click it and do some CRUD, but I just want to show a single page instead of a list, since my website only have a one home page.
 
 
2 hours later…
user10984358
5:29 AM
Heya guys, can anyone tell me how the snippet works? The second comment in the first answer is what I’m wondering about. stackoverflow.com/a/58576502/10984358
 
7:23 AM
cbg
 
7:33 AM
@TheNamesAlc can you clarify what you are confused about? input takes text input from the user/terminal/stdin. iter(input, ...) creates an iterator that repeatedly calls input -- in specific, iter(input, "") stops said iterator when the user inputs nothing (an empty string). list(iter(input, "")) feeds said input-interator-until-nothing to list, creating a list instance containing everything the user did input.
 
 
2 hours later…
user10984358
9:32 AM
I wasn’t aware that iter took arguments that were callable and the second argument then acted like a stop condition. I had to read the docs though.
 
user10984358
I could throw one of these when I’m getting input in some code challenge sites, nifty
 
user10984358
I dont have 3.8 atm, but is this identical to that, provided input is not more than the range given?
 
user10984358
[i  for _ in range(10000000) if i:=input()]
 
9:53 AM
It might need parentheses and I'd not write that ever write that as [(i:=input()) for _ in range(100000000) if i] and really that range should be itertools.count()
 
10:17 AM
@FrankAK Can you be more specific here? It sounds like you're not rendering any page at all?
 
10:31 AM
holy crap, 3.8 now has an actual API to get SomeGenericThing and (int, str) from SomeGenericThing[int, str]
That's been conspicuously absent from the typing module since 3.5.
 
10:43 AM
...except that it's got some weird special casing, so get_origin(List[int]) is list instead of List, and you can't reassemble get_origin(List[int]) and get_args(List[int]) into List[int] without undoing the special casing.
 
@roganjosh, well. I have a page render. but with a list, and then I can click each item and then I can do CRUD, everything work well. but I just want to know how to configure my home page by using the Django Admin. similar a dashboard only one page (Can be a tab on Django Admin) without list all item, as we know most of website only have one Home page.
 
@user2357112 ha
 
@FrankAK I don't understand what you mean by "but with a list"
 
For example, you can see google.com, only have a logo/ search input field, ...I just want to know how to configure my home page, what if I want to change my logo tomorrow, and I can simply do it on my Django admin by click upload image.
 
If you only have a single homepage then what are you passing to the template that causes it to be a list? What is this list a list of? How is it rendered
If you only have 1 logo that you want to change across all versions of the homepage for all users, then you would configure that in the base template, no?
 
10:50 AM
In Django, anything can be a model, and the model will store many data with the same structure, for example (username, age, sex, phone ..). so it can be a lists. and I can register it by admin.site.register, but for manage my home page, I don't want it to be many options. just one page.
 
We're not getting anywhere here. I am well aware of what Models do. Presumably you're using .all() in your query and passing the whole list of users back
In which case, that's a problem in how you query your model given the user information, so that it is a filtered result
Failing that, can you please give a screenshot of what you're talking about here
 
Sorry sir, wait me a moment, I draw a picture for you. I couldn't clear it by language. :(
 
Before drawing a picture, can you show the view and model code? (only show the bits that are relevant to this problem if they are long bits of code)
 
sure
wait a moment
 
If it's much code don't post it here directly
 
11:01 AM
cbg
 
cbg
 
@roganjosh The code it's just for demo, and to simple for you, and I just want to describe a list you can see on the first picture and second one is just the edit page, which what I want the home page to be.
code from https://docs.djangoproject.com/en/2.2/intro/tutorial02/
 
I'm starting to suspect that you want a user profile rather than Django Admin?
 
yes
that's right
so, one user only have one profile.
 
11:18 AM
I haven't used django very much so I don't know if there's some plug-n-play approach to this. I normally use flask and just write the profile page myself, and I suspect that you'll need to do that too in django for it to fit with the theme of your site
Something along the lines of How can I display a user profile using Django?. You'll need to create your own templates
 
I just try to build a website for furniture, and to client, I am using flask, but for admin, I decide to try django, that can be save my life.
Thank you so much!
 
If you're going to have to write the page yourself and you already have a flask app, I don't think you're buying yourself any advantage by trying to bring django in
 
but Django can create admin mange very quickly, are that possible to do the same thing in Flask?
 
But don't you just end up with duplicate models across both apps, or are you running SQLalchemy in both, rather than the django ORM?
Anyway, there is flask-admin but I've never used it so I'm not sure how comparable it is. I'm not sure I follow the logic of mixing the two for a single project, but I can't really say for sure whether it's easier/harder (my gut feeling is that it's going to be messy and the short-term goal of getting an admin panel gets drowned out by other issues)
 
cbg
 
11:42 AM
okay, I will try it. Thanks
 
12:05 PM
recbg
 
12:55 PM
Is there a way to convert characters like 'đąň to 'dan' effectively?
 
is there some well-maintained library for async versions of builtins like map, enumerate and so on? Just re-implemented aenumerate for the 6th time...
my google foo is failing me...
 
1:10 PM
@notatroll not really, but unicodedata can get you halfway there
import unicodedata

def asciify(text):
    text = unicodedata.normalize('NFD', text)
    text = ''.join(char for char in text if char.isascii())
    return text

print(asciify('đąň'))  # an
perhaps you can write a little parser that extracts the look-alike character from the thing's name:
>>> unicodedata.name('đ')
'LATIN SMALL LETTER D WITH STROKE'
 
unidecode might be what you are looking for: pypi.org/project/Unidecode
 
@MisterMiyagi Something like an aitertools added to the stdlib? The need for all these "a" versions of standard iterators (plus async for, async while, async with) is starting to feel like a code smell. Or maybe this is just the worst design choice, except for all the others.
If we end up seeing async print (for fstrings that include calls to async functions?), then it might be time to rethink how this is async virus can be addressed. Or maybe they'll just be called af-strings.
Can you compose an as_async decorator, so that you can just use as_async(enumerate)?
 
1:30 PM
for the stdlib, I would hope to see polymorphic map and friends -- so that one would use just one function/object to cover all variants. I don't see that working well with Python's dispatch, however. :/
and yes, it is quite a code smell. annoying when there is just a sync/async version, but ridiculous with something like map(a/func, a/iter) that already has four variants.
f-strings thankfully can evaluate any expression. Just checked, wasn't entirely sure...
one can turn sync generators into async generators easily, but not the other was around. so `` as_async(enumerate(sync_iterable))`` works but not as_async(enumerate(async_iterable)). :/
 
I was thinking of using sqlite for managing logins of a small website, but after reading this answer I am now wary of it. If two users were to log in at the same time, would that count as a different thread, and could this cause problems for my database?
 
clears throat, shuffles papers don't get me wrong, async syntax is a huge benefit in itself. But it shows how other parts of Python are not up to speed to handle such complexity well.
@Simon if things happen "at the same time" (be it via a thread, process, or task) then you can have a conflict. If your website is small enough, such conflicts are unlikely and a simple Lock should be enough to avoid corruption without sacrificing speed.
 
1:52 PM
True it's unlikely I will be getting more than two visitors in any given hour
 
This question's answer has a decorator that checks the type of the decorated method - stackoverflow.com/questions/54712966/…
 
@Simon Logging in is a read operation, not a write, so concurrency is fine
You can have multiple readers and one writer working at the same time. By default, SQLite has a 5 second timeout if conflicts do arise
And you can get further around concurrency issues if you activate the WAL
 
Ok that should be fine. I was reading this as well sqlite.org/howtocorrupt.html, it seems as long as my coding practice is good, then it shouldn't break anyway.
 
Still, I've found that 30 mins of work will get Postgres set up just fine for a small site and the issue is pretty much removed from the start
 
Yeah, SQLite has the bonus of being c compatible as well
 
2:00 PM
@PaulMcG what I'm wary about is iff there are fully polymorphic helpers, say map can be both sync and async iterable, then its concrete type depends at least on input and at worst on output as well.
 
oh wait
 
The benefit of SQLite is that is it a single file that you can copy/paste around with your project like any other file
 
It's small as well
 
we've had some pretty good usability with our API having both sync and async booleans. but it requires hand-crafting and is much heavier than some builtin bool.
 
Learning curve wise is there any bonus to using something else first. I've gone through a lot of the SQL universal stuff but not really touch SQLite specifically yet @roganjosh
 
2:05 PM
doing such sync/async return type polymorphism for more than a linear chain is not something I feel is straightforward. Especially when other people have to understand it later on, or sift through a traceback full of meta-layers.
 
If I wanted to change databases it would be easy at this stage
 
If this is something of a "toy" project (one that you are using as much for learning as the outcome) then I would start with SQLite. There is added overhead of running something bigger like postgres/mysql but they would probably be blockers to actually implementing practical SQL. If you set your project up correctly and use an ORM, you could shift technology pretty easy
Easily as in I did just that myself this morning in ~45 mins because I needed to access a work project at home, so I swapped from Postgres to SQLite3 last week at work, zipped it, and then installed postgres at home and transferred the whole thing back
Data migration is less fun, but I'd written scripts for that (they were already written so not included in the 45 mins)
One big difference is that SQLite doesn't have strict data types. It talks about them, but it won't object to floats being added to a datetime column, for example. Other dbs will not allow that
 
2:26 PM
Yeah it's kind of a practical toy
 
@Simon so like javascript?
 
I coded like a home messaging thing
it runs on LAN so only a small group of people use it
I've been using JSON to store everything before, but I've decided it might be a good opportunity to actually do things properly
 
Yeah, because otherwise you'll be serializing and deserializing the entire dataset for each query? That will become an issue long before SQLite conflicts
 
@inspectorG4dget Usually codereview will complain if you don't use snake case. There have a been a couple of notable exceptions: Apache Spark for Python, for instance is based on the Scala version and provides bindings, but scala uses camelCase, hence it is permissible.
 
2:46 PM
@roganjosh Yep, that is what has encouraged me
 
@Dair and unittest I hope :)
 
3:13 PM
stackoverflow.com/questions/58500753/… unclear (big homework dump, even stated by the OP in comments :/)
 
3:39 PM
that's a bit late. I posted that here the same hour it was posted, and no-one voted to close it, laurel
 
Oh, I don't think I saw the initial cv-pls sorry, didn't know it had been called before. Still, the OP has made no effort to address it over 5 days. I came across it because they asked another question today and I noticed that the other had nearly 200 views
 
I hate those 0 effort posts
 
Even accounting for a "meta effect" of having the cv-pls called twice, it's doubly bad that it's attracting so many views. I guess the title must be relatively searchable
Closed, thanks
 
4:26 PM
I wonder if I could still access chat if I got myself banned from SO
 
@Aran-Fey nope
 
dang
 
I don't think you can access chat if you are banned on the parent site
 
wait what, how long has jeremy been like that
 
a while
(network-wide suspension)
 
4:29 PM
[this is fine.jpg]
 
 
That's the one. Considering the current state of SO, I seriously need to find something better to spend my time on. Maybe I'll extend my list of watched anime from 200-something to 300-something, and then transfer the whole list from ANN to MAL. That ought to be an improvement
 
ANN? MAL?
 
AnimeNewsNetwork and MyAnimeList. Both let you keep track of animes you've watched and rate them and stuff
 
user10984358
4:58 PM
heya guys, is there a way in which i can pass only the second element in a list of tuples to a heapq.nsmallest call so I can find the min 2 (or more) numbers? An alternative to this
 
user10984358
>>> seq
[(0, 0), (1, -1), (2, -2), (3, -3), (4, -4), (5, -5), (6, -6)]
>>> heapq.nsmallest(2,[i[1] for i in seq])
[-6, -5]

I am expecting something like a key in a normal min function
>>> min(seq,key=lambda x:x[1])[1]
-6
 
user10984358
this only gives me the minimum
 
user10984358
actual input can have unordered numbers
 
according to the docs nsmallest accepts a key function
 
user10984358
then why was I getting an error O_0
 
user10984358
5:00 PM
must have did something wrong
 
user10984358
ok it gives me [(6, -6), (5, -5)], so I should use another loop to only give me -6,-5 ?
 
yeah, there's no way around that
 
user10984358
when you do heapq.heapify to a list, it internally converts to a heap?
 
user10984358
nothing was returned, and my type(seq) still gives me a list
 
5:18 PM
@Aran-Fey ah, I see
@TheNamesAlc the heap is encoded in the list
It functions as a heap through heapq functions. And yeah, it mutates the original.
 
user10984358
why do heapify at all? I can still do the following without getting an error, the way it is pushed changes if I heapify before?
 
user10984358
>>> seq
[1, 2, 3, 4, 5]
>>> heapq.heappush(seq,42)
>>> seq
[1, 2, 3, 4, 5, 42]
>>>
 
user10984358
so the actual percolate up and down happens only if I heapify?
 
@TheNamesAlc error no. Does nsmallest work correctly without heapify? I doubt it.
and yeah, I bet every other heapq method assumes a heapified list, otherwise there would be enormous overhead
 
5:34 PM
I'll never understand why they didn't implement a heap class
must've been a C programmer who wrote that module
 
user10984358
@AndrasDeak I get the output I expected
 
user10984358
>>> seq=list(range(6))
>>> shuffle(seq)
>>> seq
[1, 2, 0, 5, 4, 3]
>>> heapq.nsmallest(2,seq)
[0, 1]
>>> heapq.heappush(seq,-1)
>>> seq
[-1, 2, 1, 5, 4, 3, 0]
>>> heapq.nsmallest(2,seq)
[-1, 0]
 
user10984358
I just got to using heapq and I was expecting the type to come up as <class 'heapq'>, all this confusion when I realized it was a list
 
Yeah, nsmallest always seems to work. Weird.
 
user10984358
I guess I will heapify just to be sure, if anyone knows why just let me know, if its into too much of c implementation then you can let it fly
 
5:39 PM
yeah, my assumptions clearly aren't in agreement with reality, so I don't know
 
user10984358
still thanks for the other clarifications though
 
nsmallest accepts arbitrary iterables as input, apparently, not just heaps
 
user10984358
but heappush pushed as it would in a heap though, why heapify then?
 
Pushed as on a list. Can you tell what the result should've been with a heap? I know I can't.
 
user10984358
push isn't append on a list?
 
5:44 PM
nevermind, I misread again, sorry
yeah, in other languages push appends usually, I think
 
It does in JS at least
 
still both 42 and -1 was an extremal value, so not exactly representative
more like anecdotal evidence
 
user10984358
well what I wanted to was get the smallest n numbers, so is heapq the only choice for this or any other viable alternatives?
 
Sort and take a slice of the result?
 
user10984358
that was my initial solution, but I saw people telling heapq takes linear time
 
5:47 PM
Have you timed your heapq approach vs your original?
 
user10984358
I guess readability wise sorted(seq)[:2] is better to find 2 smallest numbers
 
user10984358
I didnt but the test cases dont pass if it runs for a while so
 
user10984358
if sort is not the overhead in my solution I guess something else is
 
that often needs different kind of refactoring
 
user10984358
I will just sleep on it, start anew tomorrow, if I have to rework on the whole problem again, aargh I hate interview preps
 
user10984358
5:51 PM
on a non python related note, where can I find more info on how to do bitwise calculations? many "easy" problems I use loops for have simple bit operation solutions
 
6:21 PM
@TheNamesAlc here's something to play with. It definitely doesn't win on readability but the one-pass approach wins on bigger lists
def sort_approach(lst, n):
    lst.sort(key=lambda x: x[1])
    return [item[1] for item in lst][:n]

def heap_approach(lst, n):
    return [item[1] for item in heapq.nsmallest(2, lst, key=lambda x: x[1])][:n]

def one_pass(lst, n):
    count = {i: math.inf for i in range(n)}
    for item in lst:
        if item[1] < count[n-1]:
            count = {i: count[i-1] for i in range(1, n)}
            count[0] = item[1]
    return list(count.values())
If you take lst = [(item, -item) for item in range(1000)] and shuffle it, the timeits are:
%timeit sort_approach(lst, n)
250 µs ± 30.5 µs per loop (mean ± std. dev. of 7 runs, 1 loop each)

%timeit heap_approach(lst, n)
246 µs ± 9.07 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each)

%timeit one_pass(lst, n)
153 µs ± 8.16 µs per loop (mean ± std. dev. of 7 runs, 10000 loops each)
 
hello
 
hi
 
anyone with expereicn with wsgi and flask
 
I use Flask. Whether I could answer any proper questions on wsgi is... debatable. You'd be better just asking the question in accordance with the room rules
 
ugh, who was the potato who wrote the CSS for the riddles page? That dude had no idea what he was doing
 
user10984358
6:34 PM
@roganjosh thanks for these, will definitely try out !
 
@TheNamesAlc it falls apart for bigger n values :P
 
user10984358
even if it does, that is one approach I have not seen before, so its a win-win for me :)
 
If you test it with n=100 and len(lst)==1000, for example, it's pretty hopeless. I kinda guessed that n doesn't really have to scale with the size of the list here, though
 
user10984358
in what I am dealing with n is always 2, only the size of the list changes
 
In which case, it's the most scaleable approach I can think of just using basic Python structures
If it's always 2, then ditch the dict comprehension constantly calling range and just do the assignment directly
 
user10984358
6:41 PM
yeah I guess I will stick to those, thanks again!
 
user10984358
noted
 
user10984358
7:01 PM
from itertools import tee

def isSorted(seq):
	actual,ahead=tee(seq)
	next(ahead)
	flag=True
	for curEle,nextEle in zip(actual,ahead):
		if curEle>nextEle:
			flag=False
	return True if flag else False



print(isSorted([1,2,3])) # True
print(isSorted([1,22,3])) # False
 
user10984358
if someone where to ask what is space complexity in this what should I say? its a code that checks if a list is sorted or not
 
user10984358
I typed it, usually I would do zip(seq,seq[1:]) but now I tried with tee
 
depends on whether the input list is included in the complexity
if you use tee it's probably O(1) apart from the original list
assuming tee is smart enough that it only keeps ~2 items at a time, but I'm pretty sure it is
return True if flag else False -> return flag
 
As soon as if curEle > nextEle you can return False...
 
and you can return early ^
and seq[1:] would make it O(N) more
 
7:04 PM
You'll probably also want to be careful with that next in-case of empty iterables
 
*empty? :)
 
that's what I said :p
 
my bad :P
 
user10984358
I should handle those edge cases then, didnt think of that
 
user10984358
if I am using zip(seq,seq[1:]) and I am returning if the condition is true, is it still O(N)?
 
7:08 PM
I probably wouldn't even set a flag... just do return all(a <= b for a, b in zip(actual, ahead))...
 
@TheNamesAlc yes, because seq[1:] is a copy of length (N - 1)
note that we're talking space complexity (though time complexity would also be, probably, but then you have to consider the contents and you have best/worst/average cases)
 
user10984358
@JonClements I like this
 
and probably worth considering lists of mixed types... what if input is [1, 2, 3, 'cabbage!']....
 
user10984358
they only ask big-Oh and space at most, no omega or theta
 
user10984358
@JonClements that would be whacky to ask in an interview but then again their whole point is to confuse me so I guess that is a possibility
 
7:11 PM
I think you can basically end up with
def is_sorted(iterable):
    cur, nxt = tee(iterable)
    next(nxt, None)
    return all(a <= b for a, b in zip(cur, nxt))
 
user10984358
is there any rule to know when you can directly use a generator expression without the parentheses '(' ')' ?
 
inside a function call, if the generator is the only argument
 
user10984358
got that
 
@TheNamesAlc just to point note that my is_sorted above will return True for empty iterables... that might not be what you desire...
 
user10984358
7:29 PM
doesn't empty list evaluate to False?
 
yes, but all(empty_iterable) evaluates to True
 
I don't see how that's useful behaviour?
 
user10984358
yeah
 
user10984358
any([]) ---> False, I checked
 
@TheNamesAlc that's any, not all
 
user10984358
7:32 PM
yes both should return False shouldn't they ?
 
user10984358
my understanding was all of the list is True then True, any of the list is True then True
 
Yeah, ok, I'm with you on not understanding this. Time to search for an example... to google!
 
user10984358
if [] is False then any is returning what aligns with my understanding
 
@roganjosh If the iterable returns a single falsey element, the return value is False, otherwise it's True. An empty iterable doesn't contain a falsey element, so the return value is True
the same logic works for any, too
 
all returns True if nothing is False... so empty == True (because there's never anything that can be False)... While any returns True if anything is True otherwise it returns false... and since an empty iterable can't ever return a true, then you get False...
 
7:35 PM
But is there a particular reason why an empty sequence shouldn't be special-cased in all?
 
It doesn't need to be special-cased because the default behavior makes sense :P
 
1) because it works on iterables so would have to peek ahead/do other work to determine it's empty and that might not be desirable for the programmer and 2) as I said above... it's specifically for "if anything isn't False" - not everything must be True...
@roganjosh try and think of all as "nothing seen was False"... it makes life easier :)
 
I think my brain is going "this permits bugs" but I'm not able to think of concrete examples :)
 
It can lead to surprises like a few other bits in Python, but it's fairly well documented on how it behaves :)
 
user10984358
@Aran-Fey I am going to keep this in mind and what Jon said for actual answering purposes
 
7:40 PM
Hi when I use SequenceMatcher to compare test and test 1 I get 0.8888888888888888 pastebin.com/WR6d45dx Can I make in Python test * 0.8888888888888888 and get test1. Is this possible or not
 
docs.python.org/3/library/functions.html#all - Return True if all elements of the iterable are true (or if the iterable is empty). Equivalent to:
 
@TheNamesAlc nitpick: time and space are both big-O
 
user10984358
so the next time someone asks me big-o notation I am giving them both
 
Uh, does anyone know what's responsible for the colors in these code blocks on sopython? They're all inline CSS, so I can't restyle them in my dark theme. I'm holding a wet fish ready to slap someone with, but I don't know who my victim should be
 
aside: totally forgot that the reason I used a dict in one_pass earlier on was so that we could keep the same dict memory, then went ahead with a dict comprehension to keep remaking the dict. Oh well.
 
user10984358
7:49 PM
I thought that was a "pro" move :/
 
user10984358
I legit thought it had something to do with speed
 
The approach was meant for speed. But really, since it doesn't scale well at all with n, it doesn't really make much difference
It still is the fastest of the 3 approaches, but reassigning values in a for loop vs. recreating the dict with a dict comp is basically negligible for any significant value of n (i.e. greater than 2) and I think I realised that half way through putting it together
 
@TheNamesAlc you should ask them if they mean time complexity, space complexity, or something else
 
user10984358
I have stopped looking at the problem for now :( , will get to it later tomorrow
 
"big oh notation" is just that: notation for asymptotics of sequences
 
user10984358
7:54 PM
thanks for the advice, I have to look into those, I skipped the graphical representations when they were taught to me :/
 
@roganjosh oh - what've I missed here?
 
@JonClements this
 
ahhh thanks... it's got %timeit's in it, so I think I'll leave that one be for the moment :p
 
But, but, I had a winnar! :P
 
user10984358
have a nice eve/night guys, I am off to sleep.
 
7:58 PM
rhubarb
 
@TheNamesAlc rbrb
 
rbrb
 
Hi I just need answer, possible or not chat.stackoverflow.com/transcript/message/47687068#47687068
 
sorry, I think we all missed that
what do you mean by "Can I make in Python test * 0.8888888888888888 and get test1."?
there's no way you could extrapolate from the string "test" to the string "test1" if that's what you're asking
 
@AndrasDeak Yes, I ask that. Thank you
 
8:03 PM
and you can't even interpolate from "test1" to "test", because difflib doesn't just look at substrings:
>>> from difflib import SequenceMatcher
... s = SequenceMatcher(None, "tent1", "test")
... print(s.ratio())
0.6666666666666666
you can't somehow take 2/3 of "tent1" and get "test"
 
@AndrasDeak OK. I thought that but just wanted to be sure. Thank you again
 
no problem :)
 
my sopython dark theme is almost complete, all that's left is to insert an animated gif of someone shaking their fist next to every code block
 
s = SequenceMatcher(None, 'test', 'test1')
if s.ratio() >= SOME_THRESHOLD:
    longest = max(s.a, s.b, key=len)
@Pijes @Andras I guess something like ^^^ could work depending on the situation
 
@JonClements totally unrelated, but The Pixies - Where is My Mind came on and it struck me as something you'd like. A friend of a friend uses loop pedals to basically build up tracks on his own and has a version here (which is now 8 years - ! - old)
 
8:17 PM
okay... will have to have a look... I heard that ELO have done another album/one's coming out soon - keeping an eye out for that one
 
@JonClements Thank you. I will try that
 
He also does a cover of Lithium. I'm not so much into beatboxing but I gotta give it to the guy to have the talent to build up an entire band on his own
 
Wow... not listened to Nirvana in a bit
 
>>> s = SequenceMatcher(None, 'test', 'tent1')
... if s.ratio() >= 0.5:
...     longest = max(s.a, s.b, key=len)

>>> longest
'tent1'
@JonClements ^
 
The Lithium cover is here :) Doesn't beat the original but it's one guy on his own and he did Glasto many moons back. Rare to find a guy who can sing, play the guitar, and beatbox to make up the rest :)
 
8:30 PM
@AndrasDeak yeah... wasn't quite sure of the requirements as multiplying a string by a ratio is clearly not going to work, but figured it was probably trying to find a sufficient enough match and then just taking the one with more characters in it rather than whatever... shrugs... just an idea :)
 
I see :)
I was reading it as more of a "find longest common substring" kind of problem
 
@AndrasDeak This is not what I want on start but very useful. Thanks for sharing that with me.
 
@Pijes perhaps if you described what you're trying to achieve in more detail - it's possible we could give some advice?
 
I can always give advice even without information :>
 
8:43 PM
@JonClements Nothing specific. I learn Python and find SequenceMatcher. Try it, find it interesting and get idea maybe you can get with SequenceMatcher some words if you multiple that with result you get when compare two words. That doesn't have to be exactly word but something similar in range 0.8888888 or else
 
I think that Andras already demonstrated that this score is not really reliable
 
@Pijes nope... all that SequenceMatcher.diff returns you is a ratio of 0..1 of how similar the strings are minus discard characters
^^^ just noticed an update of chrome is sending a bit more info into the linux sound bus player thingy... so now, if you play audio from a website (youtube in this case) - it populates it with more info rather than just saying "playing"
that's actually kind of nice
 
@JonClements Guys you are so smart. I am not. English is not my native so I probably make mistake when ask. I am born in socialism and very poor. Still poor after many years. Sometimes you don't understand me but I tried to be precise. All the time I have problem with communication because I can't express myself. All my emails communication dies after 2 emails. Sorry for share this with you but I feel very bad these days.
 
I have a feeling that it was you that introduced me to this song
 
@roganjosh the black keys?
 
8:58 PM
@JonClements yes
 
@Pijes I'm sorry to hear that. You're coming across as doing your best and everyone appreciates your effort in doing so. Sometimes things just aren't easy all 'round. I don't doubt you've got people willing to help you here, sometimes as you say, there can be a communication barrier. We can all try and work it out - don't worry - you're welcome here.
Take your time @Pijes - make your best efforts and let's see what happens?
@roganjosh quite likely to be I guess... fairly sure I've posted 'em in this room before and I only got somewhat into 'em because my brother went on a vinyl buying streak
 
@JonClements Thank you. That's mean a lot for me.
 
@Pijes What I would say to that: the people in this room are basically always trying to help, and being direct is not trying to be rude. We can't always appreciate what people behind the text are going through, but please don't take it as a bad thing. If something seems direct, it's probably a push to try make you look into things that will help you advance rather than a put-down. Sorry to hear you're not happy :(
 
@roganjosh Yes I see that. I love this chat. I am not happy for years but I learned to live with it. I am not happy but not sad too.
I am in some kind of climate depression.
 
You wouldn't be getting any help at all if people in here didn't think you were trying to improve. I'm sure of that. At the same time, any of us (I have a higher probability than others) can be proven to be wrong, and that's inspiration to do some research
 
9:12 PM
@Pijes while we can't help you with depression or your life in general - we'll be more than happy to help you Python programming where we can... I'm afraid the rest is up to you
 
@JonClements Sure. And thank you for all your help.
 
@roganjosh still so loving: youtube.com/watch?v=TAWx6k8ZQnU
 
@JonClements did you know Pixies - Where is My Mind before? The theme to Fight club, but wasn't sure what to make of your response earlier :)
In the End could easily have been written by Clannad IMO
 
the youtube I've found looks to be more to me like Trainspotting - have I got the right one?
 
Gah! Yeah, you're right :P
 
9:28 PM
Found a fan video: youtube.com/watch?v=FSCgfI3OG7s ?
 
I swear it was Fight Club originally... now I need to do some searches
But I also need to find the theme to trainspotting
 
the opening theme?
That was Iggy Pop
or Dr Alban - one of those
 
Ah, then it's a fan vid because I've confirmed that Where is my Mind is from Fight Club
@JonClements yes, and I hate the song
:P
 
what_year_is_it.gif
 
Give us an up-to-date "bopping" (I think that's the vernacular) tune, then, @andras
 
9:38 PM
The year when putting <marquee> tags was cool and subjecting every visited to that site not only that, but also playing MIDI files and animated graphics of people at work!? :p
 
Back in my day nobody complained of CSS!
 
I'm not familiar with that song, how does it go?
 
@AndrasDeak In my day - there wasn't CSS :p
 
> Initial release: December 17, 1996; 22 years ago
That's much earlier than I thought!
Last time I edited html was in '99 or so...perhaps I could've used css :P
 
@roganjosh another classic: youtube.com/watch?v=PXatLOWjr-k
 
9:47 PM
incidentally, I've been reading the docs of this CSS preprocessor and I've mentally exclaimed "heck yes!" at least half a dozen times. I'm never using vanilla CSS again
 
@JonClements counter attack: smashing pumpkins
 
@roganjosh great track
 
It seems you're going for a certain type of track, so I'll loop back to the Clannad parallel I drew earlier: many roads
 
beautiful... I'm starring that - thank you
 
You're welcome, I think I we have a lot in common in music :) When I was off on Fridays working for Dubai, I'd do a full spectrum of music peaking at slipknot and ending on something like that :)
Maybe some Rachmaninoff blasting out too
 
10:01 PM
@roganjosh also quite like - which you reminded me of in some weird way is youtube.com/watch?v=TgwD_SGQ394 - I like the lyrics (and the message).
(and I think I've still got it on cassette in the loft)
 
@JonClements not heard that before but the Irish population is diminishing in my pub. The modern equivalent might be this
 
@roganjosh I've listened to that recently and love it
 

« first day (3298 days earlier)      last day (1633 days later) »