« first day (3448 days earlier)      last day (1503 days later) » 
00:00 - 20:0020:00 - 00:00

12:23 AM
GOT IT! FINALLY
@AndrasDeak thank you for your help (ended up needing to downgrade to like python 3.4, but yolo this project has killed me enough)
Thanks for saving me from needing to use PHP ;P
 
 
4 hours later…
4:00 AM
Now, i got SyntaxError: f-string: expressions nested too deeply
f"{'Command': 'LOD', 'Text': '', 'ClientState': {'value': '', 'text': '', 'enabled': True, 'logEntries': []}, 'Context': {'Text': '', 'NumberOfItems': {val}}, 'NumberOfItems': {val}}"
shall i update the val with access the key itself ? better than fstring?
there am looping over pages with posting the JSON where i need to increase NumberOfItems on each request
 
 
2 hours later…
5:36 AM
Solved.
 
6:07 AM
@roganjosh Will check, thanks. I'm looking for multiplayer (so the state has to be stored on server).
 
6:49 AM
@TristanWiley you're probably aware, but just in case: python 3.4 is no longer supported, so it's in the same boat as 2.7. arguably even worse, since it's less popular.
still better than php for sure =)
 
7:30 AM
@JonClements is this link still open?
 
7:43 AM
@Arne It seems I have to start learning me some German before autumn.
 
@IljaEverilä how come?
are you stranded here and mutti closed the border?
 
8:05 AM
The other way around, the odds are in favour of us moving to Berlin in October.
Given this whole pandemic subsides enough by that time.
 
8:23 AM
oh nice, Berlin is a fun city. Very active python community =)
yeah, I hope everything is controlled enough to make a move on your side possible
 
8:39 AM
hello
 
hi
 
in the middle of my first cffi based c-interfacing module.. figured out a neat trick to get header files into a format that cffibuilder.cdef() can digest.
 
is there something weird about pyhton dicts that means i dont pick up the first 1in the testcase?
 
are you expecting a dict to give you a value before it has the key you're using?
 
no i think am i building the answer wrong
 
8:51 AM
@Permian what does "i dont pick up the first 1in the testcase" mean?
 
i get a linked list with other the last element
 
note that it seems you should be using a set, not a dict
 
considering that the list is sorted, you don't even need a set
 
i realise that now
i thought using a hashmap owuld make it more general
 
I don't understand the purpose of dummy. It seems you never modify the actual list, only the unconnected dummy.
 
8:56 AM
the dummy is to create a new list
 
but you only ever set dummy.next, without advancing through that list.
 
new version but this times out
 
while head:
    if head.val in hashmp.keys():
        continue
^ because of that part
 
why?
 
that's an endless loop
nothing changes between two iterations
 
9:00 AM
ok
fixed
@Aran-Fey thank you!
 
it seems that now you do modify the initial linked list. is this intentional?
 
its been accepted
yeah its ok now
 
is that your criteria for moving on? getting it accepted?
 
I don't see it modifying the input list anywhere
 
@MisterMiyagi yes haha
passing all the test cases
 
9:03 AM
@Aran-Fey right, I was confused by the assignment to cur. Thought it was a node from the original list.
@Permian okay, because your code is, like, far from adequate.
 
@MisterMiyagi why?
 
I'm surprised the return 0 didn't fail any tests
 
@Aran-Fey it did
 
the programming thing is that you are misusing dicts as sets (what I said), the algorithmic thing is that you are tracking the seen nodes in the first place (what Aran said)
Since the list is ordered, all you need to do is compare the val of head and head.next.
 
9:44 AM
Alright, I have encountered a new low for "unbelievably obscure questions". The very first line is class function:
 
9:58 AM
Java!
 
Utinni!
 
10:12 AM
Cbg
 
10:33 AM
bref cbg all
@Aqua4 should be, yes
 
11:03 AM
df=sc.parallelize('/FileStore/tables/COVID19.csv')


df.select(*(col(ConfirmedCases).cast("float").alias(ConfirmedCases) for c in df.columns))



df = df.withColumn('ConfirmedCases', col('ConfirmedCases').cast('float'))

ERROR:

AttributeError: 'RDD' object has no attribute 'select'

OR
AttributeError: 'RDD' object has no attribute 'withColumn'
how do i change the cols into float
 
@umerselmani we're missing an MCVE. The bare minimum is telling us what sc is, and then we don't have test data.
you have to look at the docs for whatever an RDD object is
 
11:38 AM
upside of WFH: we can finally push python3 to production \o/
but it's python3.4 D:
 
12:02 PM
I've been trying to come up with an adequate reaction to that give for almost 20 minutes. The accuracy is striking.
 
What should be do about all the "Tensorflow" questions that are actually just about Keras?
 
12:17 PM
^ closed
 
12:41 PM
@umerselmani IIRC you cannot use dataframe api functions with RDD objects . may be this can help
 
12:55 PM
Today I am annoyed by answers that say "you have a typo on line x, fix it and that should solve the problem" when the typo is clearly a transcription error in the question and not the actual code, and there is clearly an actual problem with the code, and the answerer would have known that if they spent five seconds testing their own answer
 
I've verified that this Q is technically a dupe of this older Q. I'm not sure if that is obvious to the OP, though. Is it still worth answering?
 
Double demerits because if a question is solely solvable by pointing out a typo, it should be commented and closed, not answered
 
Did you berate them for sending civilisation down a slippery slope paved with unmaintainable knowledge bases?
 
Not this time. The OP's underlying problem is some kind of weird environment setup issue, which are always muddy enough that there's a 10% chance that the OP really did just fat-finger a command
 
without having read the links, if it's a dupe but not obvious, is it possible to clarify the connection in a comment?
if so, id dupe and comment
 
1:03 PM
Not enough of a sure bet for me to give a soapbox speech on the decline of humanity, but enough of a likelihood that it triggered flashbacks of every other time this has happened
 
@ParitoshSingh It's obvious enough to me after a comment, but it's about typing. MisterMiyagiObvious isn't necessarily GenerallyObvious.
 
having now looked at the links, i see type hints, and so i've decided it can go back to where it came from, and i'll be happy :P
@MisterMiyagi This is true. be like MisterMiyagi!
 
The dupe-candidate solution is "replace Type[T] with Callable[..., T]". The Q solution is "replaced Type[T] -> Type[Sequence[T]] with Type[T] -> Callable[[Iterable[T], Sequence[T]]". That's a one T versus two T question. Which is interestingly enough precisely the problem.
Very Meta.
 
Fresh cabbages everyone
 
1:20 PM
cbg
 
1:31 PM
cbg
 
Every single person that is working not-from-home right now because they're "essential" should get that in writing so they can windmill slam it on their boss' desk the next time they negotiate a raise
 
1:50 PM
@smci I was rather surprised that they offered something similar here (Germany). It's quite unusual to get bonuses, and in fact it's often illegal to get paid extra due to the way academia is paid.
 
Hmm, where is list.__mul__ implemented in the Cpython source? I don't see it in Objects/listobject.c.
It's not squirreled away in some weird abstract base class for sequences, is it...
 
the builtins don't derive from ABCs, they are merely registered as implementations
 
Yeah, which would make it extra weird if it was implemented in some weird ABC :-P
Maybe it's doing some trickery to share tuple's implementation.
Not that that's helpful, since I can't find tuple.__mul__ either -_-
sequence_repeat looks important, but I'm not sure how it hooks into anything yet
 
did you take a look at what's in the slots?
 
Cbg
 
2:02 PM
I did, but I was only looking for "mul". Now that I look for "repeat", I see list_repeat
 
right, sequences have those weird other methods, don't they? so + is concat, not add, and * is repeat, not mul.
 
All of this was prompted by stackoverflow.com/questions/60850062/python-functiun-with-list. I wanted to confirm my suspicion that [0]*n, despite being not particularly idiomatic, could plausibly be faster than the usual method of creating an empty list and appending to it. As I thought, list_repeat performs only one memory allocation. Multiple consecutive appends perform, what, log2(final_size) allocations?
I suspect a list comprehension trumps both though
 
[0]*n should be faster than .append(0) n times since the latter has to lookup append n times.
[0]*n basically just has to copy an array of pointers, and increment refs n times at once.
 
If PM were here, he would suggest doing x_append = x.append before the loop to save a lookup
 
that's still a local lookup.
did you benchmark it yet?
 
2:14 PM
No, but there's an answer on the question now indicating that [0]*n is slightly faster than consecutive-append-without-any-lookup-saving-tricks
 
so, l_append does make it faster, but [0]*n is still faster
 
I usually reserve benchmarking for when the efficiency of my own projects depends on proper optimization. For armchair analysis I'm content to identify a plausible mechanism and leave it at that
 
my working assumption is that l_append suffers from being amortised O(1), i.e. not O(1)
whereas [0]*n with assignment is actual O(n) with n actual O(1) steps.
 
I'd say the local lookup situation is a tie, since x[i] = i and x_append(i) both have to do two name lookups apiece
 
AFAIK special methods are faster to look up.
[] is known to be a slot, append is not.
 
2:19 PM
Or is x[i] = i three lookups? Unclear to me whether the two instance of i can get looked up once. Maybe not?
 
look at the dis you should
 
@MisterMiyagi I agree, I expect list.__setitem__ to get found blazingly fast
@MisterMiyagi Let's see... there's one LOAD_NAME for x, and two LOAD_NAMEs for i. Ah well.
 
now as a homework, please work out the residency of i in the CPU caches during the lookup i, x, i.
fun fact: practically every question is a homework question now
 
A student disciplined in the ways of independent studies may find themselves awash with opportunities at this point
I, on the other hand, will most likely get distracted and look at twitter
 
that reminds me, there's still a demo compiler waiting to be written...
 
2:39 PM
@Kevin maybe not since asspressions?
x[i] = (i:=i+1)
Not sure if that can actually mess with lookup
 
There are probably a number of hijinks you can pull where i's value changes between evaluation of the left side and the right side
I certainly won't claim that it would be easy to implement a super efficient lookup optimization that knows in exactly what circumstances the value won't change.
 
anyone else find heapq hard to use?
 
I think the interface is a bit awkward but I can usually get it working properly if I read the documentation with care
 
its like you have still pretend its a list
 
I'd honestly prefer a proper Heap class rather than this song and dance of calling functions on a list
"This provides more flexibility because the underlying type doesn't necessarily have to be a list", you hypothetically say? True. Ok, compromise: make the module provide the existing interface, and a convenient Heap class.
 
2:58 PM
i find a little horrible
 
@toonarmycaptain What's the word on PyTexas, have they announced a postponement or cancellation?
 
3:22 PM
in a while loop you'd need to increment i and j manually
 
while j < len(t) and i < len(s):
@Dodge but its not clear how this would iterate
 
it will iterate until the condition for -both- one of the two is false
 
@Permian it didn't. It would happily run forever if you don't increment the values, and the conditions allowed it to enter the loop to begin with
 
while j < len(t) and i < len(s):
            if s[i] == t[j]:
                i += 1
            j += 1
        return i == len(s)
 
3:24 PM
well that tells you exactly how they increment
 
remember i am stupid
this to me looks like it iterates i and j at the same time
 
No it doesn't. It does a logical check on both values before iterating
 
ok
i see now
 
On each iteration of potentially an infinite number, it will check to see that both conditions are true. If either of them are not, it stops iterating
 
@Permian what is that supposed to do?
 
3:34 PM
I'm trying to get a python dictionary of, .e.g. {0: [1, 3, 6, 8], 1: [3, 5, 6]} in Cython, whereby the values stored against the dictionary keys are of type Py_ssize_t. I keep stumbling over piecing together the approach and the attempts that may have worked, I don't actually know whether I've succeeded. Can anyone give any pointers (pun probably not intended)?
It's not clear to me whether print(type(v)) would ever give something other than int if I iterate through the dict, for example
 
@roganjosh can't you create Py_ssize_t scalars to check the latter?
 
Ok, I should have started with that, I'd started looking at arrays and missed that step. It comes back with int, so that's not a viable check
 
user11585758
Guys i have problem please help
 
So folks, I had a quick question. How many of you use PyCharm?
 
user11585758
Pycharm ouch , its so heavy
 
3:44 PM
I use PyCharm at work and home, community at work, pro at home
 
@GamesBrainiac You're not going all advocate on us are you :)
 
But yes, it does suck up the computer resources
 
user11585758
I want to load all images from folder , but inside which there are different sub folders which contain different folders and folders and images and there are many such folders
 
user11585758
guys , how could i load all images from these folder ? Help me!!
 
@mathematics google "python walk directories recursively"
 
3:46 PM
@JonClements Yes, a little. We had a meeting, and the thing is people like PyCharm a lot, so we are trying to figure out things to make it even better. We're kinda stuck because we feel that PC is feature complete.
 
@mathematics and please cut down on the annoying fluff
 
@mathematics By heavy you mean, it takes a long time to start up?
 
user11585758
oh sorry , found . Thanks,
 
@PaulMcG Community at work? Thats interesting.
 
Um, I have to go now
 
3:48 PM
@GamesBrainiac sorry to say - I just don't use it
 
user11585758
Ok @AndrasDeak . :)
 
@JonClements No worries!
 
If I wanted to use an IDE I'd probably use pycharm
 
I also use pycharm, both at work and at home
 
@AndrasDeak yeah... that pretty much sums up my thoughts :)
 
3:51 PM
Ahh, so guys just don't need PC, because for the work you need, an editor is enough.
 
@GamesBrainiac yup
And I'm a luddite
 
haha, thats fair.
 
I'm just boring? :)
 
I'm boring too :D
 
yay! let's form a club! :)
 
3:55 PM
Sure, I'm game :D
 
user11585758
oh found os.walk() helped :)
 
user11585758
4:15 PM
guys
 
user11585758
How about coronavirus
 
I think os.walk is a lot of people's first introduction to the concept of iterating using multiple variables. They look at the sample code in the docs, for root, dirs, files in os.walk('python/Lib/email'):, and their brain explodes
 
user11585758
Yeah :) I am working on it
 
user11585758
thinking of generating girls with stylegan
 
I award second place to enumerate, which is also common, but likely to be skipped over by a bored reader who's pretty sure they've already got the hang of for loops
 
user11585758
4:20 PM
Oh thanks , i will look at it
 
@mathematics Oh, you mean like thiswaifudoesnotexist.net? (statistically likely to be SFW, but your mileage may vary)
 
user11585758
:D , but real, like thispersondoesnotexist.com , I am currently only learning it
 
Arguably, the output of a GAN trained on real photos produces output that is exactly as real as one trained on anime characters. Which is to say, zero realness in both cases
 
user11585758
hmm
 
user11585758
have you trained it,
 
4:25 PM
I've never dabbled in machine learning. I like my computers to do their thinking where I can see it.
 
user11585758
oh , Its ok :) .
 
user11585758
Ok @Kevin bye. good night, Nice to talk to you. Take care, wash hands , dont go outside :)
 
Ok, it looks like I can get around my earlier Cython conundrum. This suggests I can use np.intp for the equivalent of Py_ssize_t, and the issues raised here seem only related to 32-bit architecture, which I know won't be an issue (I... think :P)
 
cbg-ning
quick question on django: what means from .models?
 
So I can just expand the dictionary out in python into two arrays of type np.intp; one represented by keys chosen at random (representing rows in a 2D matrix) and random picks from their corresponding lists of column indices I could pick from for each row. I need to do to the swaps 500,000 times, so I thought it worth being a bit pedantic :)
 
4:32 PM
This is a relative import from models.py in the current directory
 
@roganjosh np.intp is just int64 on my system I think
 
@PaulMcG what do you mean by relative import, pls?
 
@AndyK google?
 
@AndrasDeak done, sir! ;)
 
Just in time ;)
 
4:35 PM
@AndrasDeak always in time. the lazy dude in me is always asking without googling first ;)
 
Hmm, I wish the official tutorial mentioned that particular kind of import. It talks about, for example, from . import echo, but that's not quite the same
 
@Kevin we can raise that to the core devs...?
 
I guess the target audience for the official tutorial isn't really at the stage where they need to write their own package, and that's where you're most likely to need from .models import whatever
 
@AndrasDeak quite possibly. I wasn't sure whether there was a particular significance over ssize_t but I can't see anything that alarms me in the PEP since the maximum index I'm looking at is ~2000, so easily in 32-bit. I just wasn't sure whether, for speed, there was something I missed
 
@Kevin do you have the page in the doc?
 
4:40 PM
Sure. docs.python.org/3/tutorial/… is where the tutorial mentions from . import echo.
And, for the sake of completeness, here is where import is documented in the language reference. docs.python.org/3/reference/…
You could deduce the existence of from .models import whatever from that section, but it's pretty opaque
The important part starts at "When specifying what module to import you do not have to specify the absolute name of the module."
 
thanks. indeed. it is deduced but not saying much actually. going to talk to one of my mate, let's see what he thinks of it
 
@AndrasDeak oh, I've just been reminded of this. numexpr didn't win in the end. But, what made me think of this, is that I came across Pythran again today. Our discussion was that np.sum() wasn't threaded because it, well, isn't linear algebra. However, this might be of interest in that with, minimal work, it leverages SIMD
 
user11585758
guys one little more help
 
4:55 PM
go ahead...
 
user11585758
I have some images names which have name like
background-1024x295.jpg or 89032328_643004609797842_4670149130440409088_o-570x400.jpg
 
user11585758
they have one pattern common that 1024x295 or 324x395 , How do i check if all files contains this number like pattern not caring other like
*****-1024x295.jpg
 
user11585758
I seen regex but , i want to match from back side, ingnoring any front things
 
Regex can match the end of a string, too
 
user11585758
Please give me hint
 
5:01 PM
re.match(".*<something>$", s) matches against a string that ends with the pattern <something>
.           # any character
*           # any number of times
<something> # followed by something
$           # followed by the end of the string
 
user11585758
oh oh , that .* any
 
user11585758
Got it brother , Again thank you for helping :)
 
Or perhaps re.search("<something>$", s) is more concise... Whichever
search can start in the middle of the string so it doesn't need .*
 
user11585758
I used match as above
re.match(".*-[0-9]*x[0-9]*$", '89032328_643004609797842_4670149130440409088_o-570x400')
 
[0-9]+ for your integers (or even \d+) will be better, since * matches zero or more, but + matches one or more. regex101.com is also a good place to practice, and learn regex features.
 
user11585758
5:07 PM
My problem is I dont want to take the values that contain above match or which contain numberxnumber ,
 
I don't know what "take" means in this context
 
user11585758
:) I mean that i have bunch of images , which have duplicates and that duplicates all contain with that number x number pattern . So if i found that filename contain that pattern , I will skip it .
 
user11585758
oh thanks @PaulMcG , I will look at it .
 
Jon may have been onto something with his capture groups suggestion
>>> m = re.match("(.*)-([0-9]+x[0-9]+)$", '89032328_643004609797842_4670149130440409088_o-570x400')
>>> basename, dimensions = m.groups()
>>> print(basename)
89032328_643004609797842_4670149130440409088_o
>>> print(dimensions)
570x400
 
user11585758
capture returns none or match, is there any which returns true if pattern matches and false if not
 
user11585758
5:12 PM
yeah :)
 
AMC
Hello.
 
bool(m) -> False if None, True if match
 
bool(m) evaluates to True if m is a match, and False if m is None. Oops beaten.
You also beat me on the "change star to plus" suggestion, but I didn't end up submitting that one.
 
user11585758
Thank you I appreciate for helping me guys.
 
Kevin was kevin'd. Now the universe will implode in a recursive inverse fractal.
 
AMC
5:14 PM
Is there a specific way of dealing with answers which do not add anything which hasn't already been covered, aside from downvotes?
 
And, as always, conditions are always evaluated in an implicit boolean context, so if m: is all you need to tell whether there's a match. No bool call required.
 
@PaulMcG If a Kevin has been Kevin'd then they've been PaulMcG'd
 
By the way, don't star posts to reward users for answering your question. Your gratitude is reward enough.
 
user11585758
:D , You have done alot of help, this is only thing i can reward
 
I just found the tangled mess that is numpy.diagonal/diag/diagflat, and am fighting back the urge to rant, Downfall-style. How could people mess up something so #@$% simple as an accessor and a constructor? and the doc is a jumbled mess that tells you all about its history 10 versions ago and its unimplemented future, but not how to use it right here, right now. Like Frank Herbert's Dune, blurring future/present...
...anyone feel my pain?
 
5:21 PM
I like how that rambling about versions stops with "If you don’t write to the array returned by this function, then you can just ignore all of the above.". That would have been useful to have first.
 
@MisterMiyagi I want a samurai sword for people who write documentation like that.
 
Bomb defusing instructions from episode of M*A*S*H: 1. Cut the red wire. 2. But first, cut the blue wire.
6
 
hold on, but the current version is 1.18. And searching 1.8 goes back to 2013?
 
What's funny is I originally wrote a for-loop to set offset diagonals, before I realized these functions exist, then I tried to use them, and realize you'd need to composite three functions just to set a bloody diagonal, so the for-loop is clearer.
@roganjosh Like I said, a samurai sword is needed. ("Aeons ago, when dinsoaurs roamed the earth, we used to set a communal trap for woolly mammoths...")
You know the Full Metal Jacket Drill Sergeant ("What is your major malfunction, numbn*ts?")
Is there a Hall of Shame for APIs...?
 
I am reminded of a worksheet from elementary school comprised of a series of numbered tasks like "1. draw a square in the corner of this paper" and "2. stand up and flap your arms like a chicken". The 15th instruction was "skip all of the even-numbered instructions".
Roughly 85% of the class flapped their arms like a chicken.
 
5:30 PM
@Kevin Hah. What if the 15th instruction was "skip all of the odd-numbered instructions"?
 
We didn't cover paradoxes until middle school ;-)
 
And the 18th was "skip all of the even-numbered instructions". But do we first renumber after dropping the odd-numbered ones?
 
"Skip all instructions that instruct you to skip themselves"
 
Am I being unreasonable or is that API messy?
 
Numpy is all greek to me regardless
 
5:35 PM
I am very much confused by this Q. The OP claims pickle doesn't work for functions and classes on windows. I mean, sure, it's windows and probably does lots of bad things, but... seriously?
is that real?
@Kevin don't these usually start with "0. Read all instructions before doing any"?
@smci not at all! I'm just surprised you were able to chose one that is outstandingly messy. Reading the numpy docs always motivates me to stay in devops.
 
@MisterMiyagi As the poster child for "answers questions without reading the whole thing first", I couldn't tell you
@MisterMiyagi I can pickle.dumps a function, but trying to pickle.loads it will fail unless the original function object is still accessible
 
@Kevin as in you can load it only in the same session, or you can load it if the module still exists?
 
pickle.dumps(bar) effectively just gets pickled as "the function object named bar, belonging to module __main__". If __main__.bar doesn't exist in the loading context, then it won't resolve to anything useful
 
alright, but that's how pickle works. same on MacOS and Linux.
 
I thought that might be the case. So perhaps OP is being over-specific by saying it doesn't work in Windows.
 
5:44 PM
hi
 
hello
 
OP is using nonstandard pickle alternative dill, and py4j, so I'd be inclined to blame one of those before blaming Windows
 
@Kevin I think dill can do better function pickling/unpickling
 
dill has some pretty impressive fallbacks, but standard pickle shouldn't have any problem in that case.
 
Never mind the gaping security chasm of running code that was obtained by unpickling
 
5:52 PM
@Kevin Oh. Please drop them a comment saying that.
 
what is OP?
 
rb folks. have a good evening
 
@CodingLab Original Poster - the person that asked the question
 
6:10 PM
how do i know that the keys will be in the hashmp in sorted order when the for loop kicks in?
 
In modern versions of Python, dicts preserve the order their keys were inserted in
Incidentally, you don't need to do if head.val not in hashmp.keys(): because if head.val not in hashmp: does the same thing
You might also consider using collections.Counter, which saves you the effort of checking for the existence of keys at all
Since my_counter[x] += 1 always succeeds regardless of whether x was present already
 
@Kevin what does it default to?
 
zero
 
@Kevin thats perfect
 
...I'm afraid to ask, but why, after hearing that this problem doesn't require dicts, are we suddenly using defaultdicts?
 
6:20 PM
And numpy.matrix.setfield is just as bad, dtype is a compulsory argument for no good reason, (why oh why couldn't the method just access the .dtype of its input?), and then when I pass dtype explicitly I get ValueError: new type plus offset is larger than original type
 
@Kevin I think my most-recent star falls under this category
 
@Permian is this still the same question as a few hours ago?
 
@MisterMiyagi slightly different one
 
mmm. Cannot decide if psychological game or people have just been sitting, not knowing what OP stood for.
@Permian are you sure that these tasks are helping you? Are you getting an intuition for the language?
 
@roganjosh yeah they are a big help
 
6:31 PM
I don't want to sound awful, but I do want to make a point counter to that. Earlier you were asking about how a while loop incremented values. I get a feeling that they're too contrived to make you think about the language properly and you're missing some fundamental things
If you keep hammering these problems, you're solving a subset of things that you might confront if you had a project of your own where there is no test to pass at the end to say if you're absolutely right or wrong
 
yes but thinking of your own projects is hard and thinking of your own projects which have the right content is even harder
 
@Arne Yeah I know. For any production (or even non-production) everday project I'd use a supported version. But for this, I just gotta use what I can use.
 
I think there's value in them, but not intuition that you would get from, say, "I want to make something that does x, y, z" that you can benchmark against your own satisfaction and not what a machine says is right. You've been hammering these problems for ages
 
Thanks for the heads up though! :)
 
@roganjosh i didnt do cs and am i much better now
(yeah ive 350+)
 
6:37 PM
i agree with roganjosh. and you don't really have to think of your own projects. The same way you don't have to think about making these questions - you can always just find project ideas to implement
 
@Permian see my last post. The benchmark is you being happy with the output
 
@Permian have you actually taken the time to read a tutorial first...?
your patches of utter confusion make me doubtful
 
@AndrasDeak i used to program in pytho
but very rusty
 
there's no law saying you can't reread one...
 
i find the textbooks and tutorials are too easy
 
6:42 PM
Too easy as in "how do while loops work"?
 
yes because in a textbook the while loop will have just one parater
@AndrasDeak easy to read, hard in practice
@AndrasDeak that wasnt great
 
I'd say that all while loops have just one "parameter", i.e., the condition used to determine whether to continue looping or not. Any other variables that may or may not increment or decrement while looping are part of the overall program logic, not part of the while program control construct itself.
 
@Permian that's my point. You don't have an intuition for the language and you are facing a machine, repeatedly, and asking here for the room to figure out why it's not working
Projects don't have to be huge, full-blown, things. Could you tell me the average temperate, by month, in Manchester (UK) for me for the last 5 years? I'm trying to grow a veg patch
Don't wikipedia-cheat
 
not to mention picking up terrible programming patterns and conventions on leetcode
 
6:59 PM
Average temperature, not temperate. I can't even blame predictive text for that. Maybe I should start writing my own code challenge website
 
temperature: 47F
temperate: lattitudes 23.5° to 66.5°, both N and S
temperament: grumpy
 
I don't think I'm being grumpy, am I? :/
 
No, I'm reporting my temperament
 
ooo
 
Just got off a rather trying phone call so I must take care not to fall into a Mood
I achieved my objective but my psychic energy is drained nonetheless
 
7:10 PM
:( This psychic energy underpins an awful lot of answers given by this room
 
Well, it looks like I've finally fixed a major asynchronous issue in my automated tests at work (test does behavior A which causes product feature B to respond; test must wait for B to finish before continuing). Previous attempts either didn't detect B running since it was so fast, or failed to detect it ending so it waits forever or times out (raising a false failure alarm). Now I have an airtight waiting scheme - just in time for feature B to be removed from the product in next release!
 
@Kevin Yeah, its a real pain to deal with sometimes. Everybody's got an opinion.
 
user10984358
7:27 PM
Do code site problems really not help you? I do those at times but in his defense (and a lot of students) that decides you get a job or not, amazon asks 50-70% from leetcode
 
user10984358
but I do agree that working in own projects is the better way to learn, I come into errors and I try to fix them, so thats my writing me own question and answer :)
 
@TheNamesAlc depends on the site and the student
If it's a catalyst for your learning process then most of them are great. If you just expect solving the problems to magically teach you the language then none of them work.
 
user10984358
I agree with that, most of the people who do these do it to solve problems not understand how python does that, I try to find a python based solution some weird one liner and an actual solution so I do it "the way its meant to be done"
 
@TheNamesAlc My comments are only after several weeks of watching a repeated pattern. I've got into a habit of just skimming the questions but it was quiet so I spoke up
 
user10984358
I saw him asking about recursion as well, its because the question asks you to implement recursion, they fail to see some problems tend to be recursive, someone already told that here
 
user10984358
7:34 PM
I tried to do this codewars.com/kata/539a0e4d85e3425cb0000a88/train/python but I have no idea how I would use this in work
 
user10984358
but in his case he was asking programming questions that weren't python based
 
user10984358
so I get why regulars would react (probably not the right word ) this way
 
I agree totally with Andras that it depends on the student and the site
 
user10984358
fair enough, alright I am gonna for now, stay safe guys
 
@TheNamesAlc rbrb
Oh wow, this has to be the most dramatic edit in a question that I've seen.
 
7:53 PM
@TheNamesAlc I had an in-person interview a few years ago where they asked me to whiteboard code a recursive Fibonacci function, and I was so flummoxed at the very idea of such a thing - I just blanked. Instead I talked about recursion in general, how it works with a recursive part and stopping condition, and we got through it, and I got the job anyway.
 
@TheNamesAlc exactly
 
Recursive factorial is such an atrocious use of recursion, but it's easily taught and easily tested, I suppose.
 
@AMC oh, what? That rollback.... I'm not sure about that
 
rewriting a question without answers is weird but not forbidden
more often than not it will just lead to more downvotes
 
This is a mess now. I'm not convinced the answer posted works either
 
00:00 - 20:0020:00 - 00:00

« first day (3448 days earlier)      last day (1503 days later) »