« first day (3841 days earlier)      last day (1090 days later) » 
00:00 - 21:0021:00 - 00:00

12:00 AM
@AndrasDeak Does hearing the fact that this double is just for 2 lists and it could be thripled and so on based on different number of lists provided, help? :p
@AndrasDeak Okay weird, even when I return something, it always returns None
 
 
1 hour later…
1:26 AM
@ElderDruid - How do I write the decorator? To provide more context, I use neo4j bolt with python and this tool uses debug and hence the entire result set is printed. I was hoping to overwrite this by adding a handler but don't know how to do it. Any help or pointers is appreciated. Thanks
 
 
1 hour later…
2:26 AM
wow
 
 
5 hours later…
7:42 AM
Hi, odd question but I put a folder from my ubuntu onto an ntfs harddrive and would like to open it on my windows, but I can't see the folder. SO answers suggest to right click on the folder to go to properties and change the access, but I don't even see the folder. I checked to see if it's there and on Ubuntu I can see it. It's weird because I moved other things onto that drive with no problem, these files came from an scp command though, so that might be an issue, any ideas how I can see them?
 
I don't think it's possible to hide a specific folder on Windows. If you can't see it, then it almost certainly isn't there
 
but when open the disk up on ubuntu I see it...
 
Welp, looks like I was wrong
Have you tried attrib -s -h -r P:\ath\to\your\folder /s /d to unset the "hidden" flag?
 
I have in view the option enabled to show hidden files. So I guess I would see it? Or is that another hidden property?
 
not sure
 
7:51 AM
hmm ext2 volume manager also seems to not allow me to mount my ubuntu partition weird
Just as I suspected, turning it off and on helped. Something must have gone funky. i deleted the folder and recopied it again and this time unmounted the drive before shutdown and I can see it now
 
8:18 AM
@Hakaishin ext2?
 
@AndrasDeak linuxandubuntu.com/home/… I was following this
I thought instead of going over the drive I can access the files directly, but that didn't prove so easy
 
Ah yes randomlinuxname.com, the first four pages of google hits
 
8:31 AM
Yeah, I was also thinking, man you place too much trust in this small pinguin logo and install a program with admin rights which could totally screw you. Well aint nobody got time to be paranoid :D
 
8:43 AM
cbg
 
cbg
 
Anybody knows the search terms for clock drift of some hardware? I'm googling nano jetson clock drift but find no documentation on it. Is there another term for that? I basically need to know in x time how far off the clock will be
 
9:29 AM
Hmm, I checked the nano jetson technical reference manual and the ARM® Cortex®-A57 MPCore Processor TRM, but none talk about clock drift. I find this kinda surprising, isn't clock drift an important information, especially for such devices which are not necessarily always connected to the internet. Also wow, atom clocks are so cool, off by 1s in 15 billion years :O
 
10:24 AM
well, important is subjective. Maybe majority of their user base doesn't really care
 
10:49 AM
@Hakaishin From my experience, clock accuracy is most important when distributed actors cooperate – which implies that they can synchronise information and thus clocks. The wikipedia article on clock drift suggests that causes are mostly environmental, so just knowing some average won't help you to correct drift in practice.
There's an SU Q&A on expected clock drift for PC/ntp, which suggests anything between 6s/day to 12s/week is "normal". That sounds pretty awful, TBH. So the options seem to be to either not rely on precise time, or synchronise explicitly.
 
@MisterMiyagi I need it for legal metrology. Thus if I know the environment temp/humidity and I know the operating ranges of the device and I know the clock drift I can satisfy my requirements. I know the first two things, but not the last, thus my question.
@MisterMiyagi Yes that's why I would like to know the specifics, because we have other hardware where they did specify it and it's something like 0.1s in a year. Don't remember exactly. But low enough for our use case. But I'm not sure if that is also true for the Nano jetson
 
My recommendation would be to measure it if you already have the hardware, or put it in the procurement requirement if you don't.
 
11:07 AM
@MisterMiyagi I opened two tickets with nvidia and arm, let's see what they say. I'm not sure if measuring it would satisfy the person doing the certifications, but I might bring it up as an idea. But I feel like setting up ntp would be easier. My ideal solution would be to just attach a TRM and a section number to the email and be done with it, no need for additional code or measurements or anything. But let's see
 
raf
11:20 AM
I am trying to read the config.toml file to get and insert the primaryColor code inside the markdown of my streamlit app. Something like this:
import streamlit as st
import toml
primaryColor = toml.load(".streamlit/config.toml")['theme']['primaryColor']
st.markdown("""
<style>
div.stButton > button:first-child {
    border: 5px solid primaryColor;
}
</style>
""", unsafe_allow_html=True)
What should I do so that markdown can the read color code in the place of border: 5px solid primaryColor?
 
Um, insert the value of your primaryColor variable into your CSS code?
 
@raf Are you looking for "string formatting" perhaps?
Wait, is that bad practice for CSS?
 
raf
I am confused about how to explain it. I am looking for a method that can insert the color code from my config.toml file to my code.py file automatically. so that whenever I change the color in my config, the code.py file can access the code too.
Does it make sense? :|
@Aran-Fey yes, how?
 
Isn't the entire point of a configuration file so that whenever you change a value in it, your code can access that value?
I'm going to endorse the "try string formatting" suggestion
 
@raf :|
Google can answer that
 
11:30 AM
>>> primaryColor = "red" #imagine that I loaded this from toml
>>> s = f"<style> foobar > bazqux {{ border: 5px solid {primaryColor}; }} </style>"
>>> print(s)
<style> foobar > bazqux { border: 5px solid red; } </style>
Note the double curly brackets which are necessary because single curly brackets have a special meaning inside f strings
You can use f string formatting on triple quoted string literals too, incidentally. I didn't demonstrate because I wanted to keep things short
 
raf
@Kevin Thank you.
@Kevin I get your point. Thanks a lot.
 
semi realted, curious. is there any issues with .py files as config files?
 
I do it occasionally, yet I feel a small amount of inexplicable guilt in the process.
Ghost of Turing looking over my shoulder like "this file doesn't even have a loop, what are you doing bro"
I think the only time I regretted it was when I needed to reload the config file in the middle of the program execution. It's easy to open config.ini again; it's (relatively) hard to re-import config.py without it just fetching the old data from the cache
 
11:55 AM
@ParitoshSingh I liked them for a while, but found it very difficult to design usable configuration system around. Either you do need the flexibility, in which case it's a usability nightmare by design, or you don't, in which case an INI/JSON/TOML is much more familiar to people – and less error prone.
 
yaml all the way :) Nestings are nice
it also fits better with the python style, whitespaces and all, compared to json
 
Confession: Yesterday I used an ad-hoc newline delimited data file instead of proper json/yaml/whatever, because this:

    cake
    2
    800
    6 eggs
    1 cup sugar

is easier to write than this:

    "name": "cake", "servings": 2, "calories": 800, "ingredients": {"eggs": 6, "cup sugar": 1}

... When you have fifty different entries to type up manually
I tried it the right way, got two records in, and thought "yeah I'm not typing 'ingredients' 48 more times"
I also wanted to be able to put down 2k for calories and have it understand that as 2000, which isn't easy in json, but is easy when you're building a parser from scratch
 
12:11 PM
cool, appreciate the insights folks
 
12:21 PM
what's a good word for data to be investigated in the context of ground truth? Currently I have ground_truth_data and data, but I would like to make it a bit more descriptive
 
@CoolCloud Clue: try something more like def myzipper(first_arg, *remaining_args) to handle a variable number of arguments. I've made the first argument required, because it should be, and also because it is (or might be) convenient in the logic to have the first item available. Until I have evidence on that point it's really a premature optimisation.
 
save yourself one underscore by using "empirical" in place of ground_data?
 
@Hakaishin I can't say the _data suffix adds enough information to justify its inclusion. What about ground_truth and speculative?
 
Name them data1 and data2 >:-)
 
i usually use pred/predictions and gt or ground_truth depending on my mood. this ofcourse assumes your data is in the form of predictions
or you can always go for the y_pred y_true approach, that's always reliable
 
12:31 PM
Hmm, an interesting peek into the idioms of the sciency side of Python
For all we talk about numpy and similar in here, 99.9% of the code we discuss just calls everything df
 
df it is :D Haha
@holdenweb True, I feel speculative has a negative connotation to it. i think I'm gonna leave it data :P
@Kevin <:-)
 
My favorite algorithms are ones where I can give everything names like seq because i don't know or care about the intended meaning of the object's contents
The ideal state is to be like itertools and name all your arguments iterable
.chain works on both empirical and speculative data! The apex of flexibility!
 
1:18 PM
Thinking about the requirements of this stage of my project...
- present numeric data about my 50 unique items in an orderly manner
- make it easy to modify item values and attributes, preferably with instant updating of calculated results
- familiar interface for normies
- portable between Windows machines
... And I came to the conclusion that I should throw everything out and write an Excel sheet.
So this is the power of the world's most popular programming environment...
 
hey guys, does anybody got some free time to help up around kivmob problem with ads?
 
Same problem as the one described at stackoverflow.com/questions/67186516/…, I'm guessing? I'll give it a look although admittedly I don't know much about kivy
 
1:39 PM
@Kevin rofl, that felt like a personal attack.
yep..lots of df here...
 
1:56 PM
@Kevin yeah... thanks a lot, any help is good
 
I do think df is a reasonable name in the right contexts, if anyone couldn't tell whether my talk about seq and itertools was satirical
Sometimes you just gotta do a thing to a dataframe without knowing what's inside
 
2:16 PM
@holdenweb Hmmm Ive been thinking of something like that, but I just completely dropped it as the overall logic seems bad.
 
2:40 PM
Ooh, I love "mysteriously returns None" bugs. I don't know what the original problem is, but if you have an MCVE, I will happily look at it
The nice thing about code path analysis is, you almost never need to understand the business logic
 
we already see why it returns None on the inequal branch, but having said that, using nested loops to create a pretend-zip is so insanely inefficient that it's not even worth fixing bugs in that code i feel
 
Does someone know of a good tool to create stub files from importable modules? We're dealing with a wrapper around numpy that totally kills inspection tools.
 
this or this kinda thing?
 
If chat.stackoverflow.com/transcript/message/52040040#52040040 is the code, Andras hinted at it, but I'll say it outright. The final line in your function has to be return my_zipper(lst1,lst2) rather than just my_zipper(lst1,lst2)
 
with the disclaimer that i havent used either of those
on closer inspection, it seems like they're talking about the same thing
 
2:45 PM
In my troubleshooter-for-hire experience, "called the function recursively, but didn't do anything with the result" is the #1 cause of mysterious Nones in recursive functions. Maybe even the #1 cause of the more general category of "my recursive function doesn't do what I want"
 
^^^^ Great psychic debugging!
 
i've got a close contender for that one, though maybe this is more relevant for beginners. My close contender is people using a print in the last line of the function, and then saying their value was returned but it shows a None instead
 
I think a lot of neophyte imagine some kind of automatic tail-call recursion stack trickery is going on, when really it isn't. Maybe they think that if a recursive call is the last line of a function, it will replace the existing function on the call stack rather than pushing on top of it and leaving the original where it is. That basically is how tail call recursion optimization works in languages that support it, so it's funny that so many people invent it independently
 
@ParitoshSingh yeah, looks good. Gotta try whether it works for our usecase.
 
i'll keep my fingers crossed for ya
 
2:51 PM
If Python had this imagined tail call trickery, you wouldn't need to put return in front of my_zipper(lst1,lst2), because once the second my_zipper executes and obliterates the first, the return opcode would cease to exist and never get executed.
 
That's... not what TCO does. :P
 
Yeah I'm glossing over a lot of details and also implying that TCO works in far more scenarios than it actually does
The big picture is correct, in the same sense that "blue circle" is a correct big picture of the earth
Not a circle, not even a sphere, not entirely blue, what even is "blue" anyway -- 4x wrongness packed into two words, and yet it's good enough for pop sci PR
 
The fabled "Blue Circle Optimisation" strikes again.
 
Greetings
 
3:02 PM
greetings
class RegisterForm(UserCreationForm):
    class Meta:
        model = User
        fields = ("username", "email", "password1", "password2")
 
Hey, @MisterMiyagi, do I remember you expressing an interest in the Nutshell 4th edition?
 
@ParitoshSingh didn't work, I'm afraid. :/ stubgen seems to only statically process the file – it doesn't get the from ... import * and various loops to wrap objects.
 
could I know, how do I use class in each fields, it's django based
 
@holdenweb In case I did not express interest, let me just quickly express interest. Yeah, I'm interested.
 
@Manisha please don't ask for help here with fresh questions on the main site as per our rules
 
3:07 PM
@NIKHILCHANDRAROY If you're asking "How do I specify the type of field for usernaame, email, password1, and password2?", I think you only need to define them in the User class.
 
@AndrasDeak Oh sorry.. I dint know..
 
@Manisha it's alright, thank you for understanding :)
 
@Kevin I want to trigger class attribute like <input class="form-control" type="text">
 
I was thinking it might be possible to take advantage of your typing interests, at least as a technical reviewer. That's a reasonably critical new area (the 3rd edn has about a page on annotations and type hinting). It will be a major pain to even decide what to include and what to leave out.
Depending on how confident Alex is in that area we may an author. but that's TBD.
 
@NIKHILCHANDRAROY If I'm reading docs.djangoproject.com/en/3.2/topics/forms/#the-template correctly, all you need to embed your form into your template is {{ form }}
The kind of day I'm having: googling "recursive sql query" with the sincere hope that it returns a solution
 
3:16 PM
@holdenweb Sounds good. I'd be happy to offer whatever help is needed.
Let's kick Python introductions into the century of the fruitbat!
 
but, it's giving default html tag with attributes I want to add more attributes, classes
 
cabbage
 
@NIKHILCHANDRAROY Perhaps you can use docs.djangoproject.com/en/3.2/topics/forms/… to customize the presentation of your form.
 
@Kevin I think you'll want a Common Table Expression?
 
@NIKHILCHANDRAROY sorry, I'm just jumping into the conversation now. Which tags do you want to add classes to? The main <form> tag or <input> tags or something else
@NIKHILCHANDRAROY stackoverflow.com/questions/29716023/… shows one way to do it.
@NIKHILCHANDRAROY stackoverflow.com/a/50524134/1440565 I think this answer is the best one. You might even consider making your own custom widget classes so you can reuse them over multiple forms.
 
3:21 PM
@roganjosh That's what my first google hit suggested. I haven't yet comprehended whether it suits my needs or not. I give it a solid "maybe???"
 
They do come in a recursive flavour, where you can go down the family tree of parent-child relationships. Of course, I don't know what you're trying to solve, so it's a solid "maybe" from me too :)
 
@Kevin I was able to ctl z back and get the code
lst1 = [1,2]
lst2 = ['a','b','c']

def my_zipper(lst1,lst2):
    if len(lst1) == len(lst2):
        main = list(zip(lst1,lst2))
        return main
    else:
        if len(lst1) > len(lst2):
            big = len(lst1)
            for _ in range(big-len(lst2)):
                lst2.append(None)
        else:
            big = len(lst2)
            for _ in range(big-len(lst1)):
                lst1.append(None)

        my_zipper(lst1,lst2)

print(my_zipper(lst1,lst2))
 
@CoolCloud Yep, as I suspected. You're missing a return.
If you missed my overly wordy explanation, it's four pages up
 
but there is a return there..
 
hmm hmm
mysterious python is mysterious
 
3:24 PM
@CoolCloud I count one return statement total, within the body of two conditional blocks. No bueno. Both blocks need a return
 
@Kevin Thad actually made sense
I added return my_zipper(lst1,lst2) and it works :D
 
And the lists are possibly changed after calling it
 
Yea....
 
It's a feature
 
Damn right it is :P
I mean using a copy feature it triggers maximum recursion, so I guess ill just leave it here.
 
3:31 PM
Great way to learn
 
How terrible is this in an __init__.py:
from .my_project import *

__all__ = my_project.__all__
 
What does the second line change?
 
prevents the my_project submodule from being imported if someone does from my_project import *
 
Must be something subtle
@Aran-Fey so basically del my_project?
Or did I misunderstand?
How many namespaces are there?
 
Hmm, yeah, that's pretty much the same thing actually
What exactly do you mean by "namespace" here?
 
3:40 PM
I use(d) a del like that in a package of mine so I wouldn't judge
 
@erotavlas Did you try running from the command line? Often doing the same thing two different ways can help narrow down the problem.
 
@Aran-Fey I wasn't sure if I was missing the context. You import my_project in your __init__.py but then talk about this fixing from my_project import *, so I figured this is probably my_project/__init__.py and my_project/my_project.py, but I wasn't sure. So there's my_project the package and my_project the module. Two namespaces.
 
Ah, yes, that's exactly right
 
Toy example of my sql problem, which may or may not be solved by CTEs. This is quite easy to solve if I have full-powered functions, but my tools in sql land are not so sophisticated.
... But I sense I am veering off-topic, so I think I'll table this for now
Oracle devs, please allow syntax like def total_cost(name): return (food := Food[name]).cost + sum(ingredient.qty * total_cost(ingredient) for ingredient in food.ingredients)
And @functools.cache while you're at it
 
@Kevin Is Frosting in both Food and Recipe on purpose?
And is Ingredient always from Food or could it also be from Recipe?
 
3:53 PM
Everything that is in Recipe is guaranteed to be in Food. But not necessarily the other way around. Eggs don't have ingredients, so they're not in Recipe
 
@MisterMiyagi that's a bummer. theres also this tool but skim reading it makes it seem like this requires some manual intervention. and it might fail for your use case too, i don't have a great grasp on stubs or typehinting for that matter
 
@Kevin So Frosting costs $15...done
 
@Kevin you forgot to tell them to be quick about it
 
Perhaps I communicated my business logic poorly. $15 is the cost of labor to create the frosting. The total cost of Frosting is $15 plus the total costs of all its ingredients.
 
all i hear is food...
and i literally just had something to eat too.
 
3:56 PM
@Kevin thanks....that clarifies my confusion. So for Milk, the cost is just the "labor". But for Frosting, you add its own labor plus the sum all the ingredients (weighted by qty)
 
Yeah.
Now I'm wondering if I should have two separate tables for constructable foods and storebought foods...
 
and you want to do this in SQL?
 
Your cows are paid handsomely for their milk production
 
Then I could unambiguously label their columns "cost of labor" and "cost of materials" respectively. But perhaps this is silly.
@Code-Apprentice Yeah.
 
@roganjosh this assumes that the cows aren't being milked dry...(im not even sorry)
 
3:58 PM
shrug I get the meaning now. IDK if more complexity to the underlying tables adds to the purpose of the problem.
 
Yeah :-)
 
@ParitoshSingh something something cash cow
 
@roganjosh It's Kobe milk, from Japan. Very expensive. The costs of keeping the cow masseuse on retainer alone... Woof.
I have omitted the CowAssistants table from the toy example in the name of concision
 
Do you have primary keys and foreign keys?
 
those are very critical
pip install django-widget-tweaks this one saving my time
 
4:12 PM
What is very critical?
I'm not sure if you're referring to the primary/foreign keys or some earlier discussion about django. If you're referring to my question then I can just use "cake" as a key
 
In the toy example, Food's primary key is its Name column. Recipe doesn't have a primary key. In my real code, I have regular old surrogate keys for both. I'm willing to use either design.
//If I'm reading this article on CTEs right, I might be able to do this with:
with TotalCosts(Name, Cost) AS {
    select Name, Price from Food where IS_PURCHASABLE_FROM_STORE(name) //todo: implement this
    UNION ALL
    select Name, Price + SUM(select ingredient.Cost from TotalCosts ingredient) from TotalCosts
}
SELECT * from TotalCosts
IS_PURCHASABLE_FROM_STORE is equivalent to "can't be located in Recipes" and fairly simple to implement. I might need to do some weird joins, but I'm not worried about that.
 
but I'm not worried about that - talk about jinxing things :p
 
Ah, I think I have to build up from the bottom rather than drilling down from the top... That multiplies the runtime by O(len(Food)) or so, but with len(Food) ~= 50, I can afford a little bit of exponentiation
 
@roganjosh earlier, to use class attribute in html from django form
In some situations, wasting time with vs code to reload repeatedly the Django server.
 
4:52 PM
@Kevin - can't a topological sort help you here?
 
Hmm, possibly. I'm free to reorder my tables if I want, so sort-based improvements are an option
 
5:07 PM
umm... so need to find a way to get 9 rep... so I can haz 123,321 as rep... umm...
 
one upvote + one downvote, easy
 
nuke 9 bad answers you've downvoted
 
@AndrasDeak that wouldn't scream "mod abuse" at all would it :p
 
SO should drop the pretense and just let moderators give themselves whatever rep they want
 
5:16 PM
@Kevin maybe an automated task that sets every mods rep to Jon Skeet + 1 every day? :p
 
Can't abuse your power if every conceivable use of your power is explicitly permitted :tapping head smartly meme guy:
 
I like your thinking... and since we all know there can only be one Kevin - I should go off and delete every imposter pretending to be a Kevin on the system, right? :p
 
Proposal: merge them all and give me their points
 
@Kevin so is this just a toy puzzle? Or is it created from some "real" problem you are trying to solve?
 
It's real, but admittedly I'm deep in the XY Problem hole
 
5:34 PM
Not really. I've almost solved it. The cost of milk is still increasing from my time costs. here
The last part is just to stop the food_labour.price values being repeated
 
Hmm makes sense, I was wondering if it would be necessary to guard against repetition
 
FWIW I've been meaning to learn about recursive CTEs because bills of materials crop up in my work. I don't know why I've chosen this example as my trigger :P
 
Thanks Kevin
 
@Aran-Fey Except that del my_project will make my_project' unavailable inside the module, whereas the __all__` setting only affects wildcard imports (so from module import my_project will still work).
 
Well, it doesn't really make a difference because that's the __init__.py at the root of my package. Deleting the name my_project from there would only be a problem if I had code like import my_project.my_project somewhere
My imports generally look like from .my_project import Foo or from . import my_project, so it doesn't matter if it exists in the package namespace or not
 
5:47 PM
@roganjosh Oh good. I'm glad when people help me with my problems because it was something they were previously intending to learn, or for idle curiosity, or really for any reason other than "Kevin is in trouble!!!". Nobody should bend over backwards to help me, especially if I'm not bending over backwards for myself.
 
@roganjosh what still somewhat blows my mind is the example on sqlite.org/lang_with.html - while it's not what a full blown RDMS server and stuff can do... looking at the example sudoku solver is just... wowsers...
 
@Kevin I think you help enough people to be able to expect a little help in return.
 
If people keep repaying their life debts to me, what will I use to decorate my workspace? :-I
These "IOU one troubleshoot" receipts aren't nearly as nice looking when they're stamped with "redeemed"
 
6:11 PM
@holdenweb The way we help Kevin solve problems is to basically just listen and observe him solving his own problems. Maybe it's the pressure of an audience that brings out his own best problem solving abilities.
 
6:22 PM
"If you can come up with a good description of the problem, the problem is already halfway solved" certainly applies to me
Not wanting to look entirely silly is also a good motivator to apply a little more rigor than usual
 
@Kevin you totally owe us now. ;)
 
Yeah pretty much
 
6:36 PM
@Kevin I gave up not wanting to look silly years ago, about a decade after I learned egoless programming. I discovered that ego got in the way in other areas too.
 
I wouldn't mind going in that direction myself :-)
 
Give it another decade or so ... ;-)
Remember I'm an old fart.
To give you some conttext, I was about 30 when egoless programming became the thing.
 
I wonder if egoless programming still makes use of id
3
 
I get that joke
 
@AndrasDeak /nodshead
 
6:49 PM
The strengths and weaknesses of egoless programming as described by Wikipedia are hilarious. Strengths: people talk more and are happier. Weaknesses: simple things are over complicated, people generate riskier solutions, projects take longer to complete, and failure rates are higher.
 
@JonClements Yeah, that is a bit wild! I find the docs quite confusing usually but they're not too bad on this one (I neglected them anyway on the assumption I'd get confused and found other examples)
I don't think I can quite get my head around the flow diagrams. It just doesn't compute correctly in my brain. I'm sure that others rely on them and find them useful
@Kevin I mean, I would like to think I'd lend a hand on any problem if I thought I recognised it and had time. The fact it was on my bucket list is just a bonus :) I've realised there's a couple of steps missing from my solution but back on it now
Also, I need a distraction from that Markov-chain-but-not-actually-Markovian-or-possibly-even-soluble problem :)
 
as a hobby project you could try figuring out what information would be necessary to make it into an actual Markovian problem :P
 
7:10 PM
@holdenweb egoless programming is actually a thing?
 
When you lived through it, the Wikipedia article is transparent tomatoes. It was much simpler than that, and nothing to do with technique.
The rules are simple: "It's about the code, not you."
It was a thing when being a thing was a thing, yes. But it was orthogonal to programming technique.
 
Reading That Coding Horrors summary of the ten commandments of egoless programming. I've heard the "you are not your code" mantra often.
and basically all of the others in some form, too
 
rewriting Perl code of those flexing how "cool" they can be with their code was a nightmare.
 
@piRSquared that's surprising, coming from you
 
It was difficult at first to drop the defensive mindset. I was a typical obnoxious nerdy geek in my twenties and thirties, more concerned with being right than solving problems.
 
7:16 PM
which is why I practice the horrible to get it out my system so I don't put it in "real" code
 
@piRSquared how is that working out for you? :P
 
And for us :-)?
 
I'm proud of my production code... well proud-ish
 
@holdenweb The Wikipedia article does a terrible job of describing the concept. It makes it seem entirely useless, which it isn’t, as you assert.
 
OH but wait. I'm not supposed to be proud.
 
7:17 PM
I'm guessing you get 90% of the benefits of egoless just by being nice and not taking criticism personally. In the other 10%, perhaps there is room for some some coding techniques, along the lines of "design your API so it doesn't make the other person want to kill you"
 
aside: what exactly are "transparent tomatoes"?
 
How unusual that Wikipedia should promote a partial and ill-informed view of a topic </sarcasm>
 
Ha!
 
@Code-Apprentice The salad dictionary is your friend.
 
@Code-Apprentice They are tomatoes that light can pass through.
 
7:19 PM
@piRSquared I was also very literal in my twenties and thirties ...
 
I'm passed that so I have no excuse
 
TBH I'm still pretty literal.
 
@holdenweb oh...I thought it was a more general phrase that I wasn't familiar with rather than a Room 6-ism...
 
I gave my kids a pet peeve of being upset when "literally" gets used figuratively.
 
No, but it will probably now find its way into RL.
 
7:23 PM
@piRSquared just when their language is officially adopting the other meaning? Poor kids... Might as well teach them about kerning if you're so evil.
merriam-webster.com/dictionary/literally: " : in effect : virtually —used in an exaggerated way to emphasize a statement or description that is not literally true or possible"
 
lunch rbrb
 
"literally" is allowed to mutate into a nonliteral form, but I insist that we come up with a replacement for it first
It too will become figurative one day, but let's focus on keeping the treadmill spinning in the here and now
 
What, you thought published text was easy to read by accident ?:-)
Electronic publishing was my research topic back in the eighties so I learned all about that stuff. Forgotten most of it now!
 
Kerning makes it harder for me to reinvent text recognition from scratch, so I am against it
Give me monospace fonts with no aliasing, please
 
Simplifying the real world doesn't count as a software solution.
 
7:30 PM
@piRSquared also Kerning
@holdenweb did you cross paths with Knuth, one way or another?
bless that man
 
Sadly, no. Maurice Wilkes was about the most eminent person I got to spend time with (at a conference at the University of Kent at Canterbury). A very engaging speaker.
 
"and who invented microprogramming", OK, that sounds cool
 
When I started teaching at Manchester University the Head of Department was Tom Kilburn, and the other profs were Dai Edwards, Frank Sumner and Derrick Morris, none of them well-enough known today for anyone here to recognise their names, I suspect.
 
@AndrasDeak Thank you?
 
"the central processing unit of a computer could be controlled by a miniature, highly specialised computer program in high-speed ROM." Where is this program executed? In the CPU it controls?
 
7:39 PM
yes
 
laurel (-:
 
@Dodge \Indeed.
 
But the CPU the program controls can't process things until it processes the thing that enables it to process things.
Chicken and egg in my mind
 
In design terms microcoding is just another layer.
Python, C, Assembly language, Machine code, microcode ...
But machine code is translated into microcode on the fly by the hardware.
Burroughs produced a line of machines with programmable microcode, which were very useful for experimentation. I never got to use those, though.
 
I see, the CPU still has its own internal hardwired control system and the microcode simply enhances the CPU's capabilities rather than acting as an outright replacement of the hardwired control, which I'd just assumed initially. Which is why I was confused.
 
7:52 PM
@AndrasDeak My 8yr-old walked up to my screen and asked what the xkcd-Kerning was about... so I explained it to him. He pointed out the bad kerning and we laughed. So begins a life of turmoil. I'm sorry, son.
 
I'm proud of you both
Now blow his mind with "keming"
 
@piRSquared I had to review what "kerning" means. I'm pleased/disturbed that I spotted the problem in the comic before checking the official definition.
 
rbrb folks
 
AAB
8:19 PM
cbg all,
I ma using python regex match
this is the pattern \b(fx-)?\d{3,6}[a-z]{0,2}\b
this is the target string
AMD RYZEN 5 1500X 3.6 GHz Socket AM4 Desktop Processor with Wraith Spire 95W cooler
In regex101 website I get the match as 1500X
in python re.search(pattern, name, flags=re.IGNORECASE)
returns none
 
Do you have a raw string literal for the pattern?
MCVEs save lives
 
AAB
Yes the pattern in python is declared as follows r"\b(fx-)?\d{3,6}[a-z]{0,2}\b"
 
@AAB OK, so let's switch to that MCVE.
 
AAB
what is MCVE?
okay got it
 
AAB
8:22 PM
(⊙_⊙)
 
yes?
NameError on target
 
cbg
 
AAB
@AndrasDeak yea copied the one from interpreter let me post new one
 
8:29 PM
@Kevin Have I fixed it? I ended up getting distracted again sorry. I had to change some of the numbers to be a bit ridiculous to be able to see what I was affecting. Or, y'know, 56 eggs in a cake might be doable
MIN() is an annoying aggregator in SQLite. Redshift will give you ANY_VALUE but meh, does the same thing. All I want is one value from a sequence of repeated values
 
@AAB seriously?
Do you really not see how this is worse than what you originally showed us?
 
AAB
why?
 
In [218]: import re
     ...: pattern = r"\b(fx-)?\d{3,6}[a-z]{0,2}\b"
     ...: target = 'AMD RYZEN 5 1500X 3.6 GHz Socket AM4 Desktop Processor with Wraith Spire 95W cooler'
     ...: re.search(pattern, target, flags=re.IGNORECASE)
Out[218]: <re.Match object; span=(12, 17), match='1500X'>
here's your MCVE ^
And now you see why I'm asking for an MCVE.
...or maybe not. But this is why I'm asking for an MCVE.
 
@AAB Can you tell me why this code doesn't produce any output?
with open('foo.txt') as file:
    for line in file:
        if 'foo' in line:
            print(line)
 
AAB
8:37 PM
@Aran-Fey probably the file is empty or none of the lines contain 'foo' string in them
@AndrasDeak I included the DB bit cause I thought may be that is altering the result
 
Hmm. No, I'm sure there's a line containing "foo" somewhere in that file. Now what?
 
amazing
 
AAB
@Aran-Fey :|
 
That's what you're doing to us right now.
 
@Aran-Fey try doing file.readlines()
 
AAB
8:41 PM
@Aran-Fey @AndrasDeak sorry about that.
 
It's alright, this is the gift that keeps on giving
 
@12944qwerty That's not the point. Aran-Fey was making an illustration
 
@12944qwerty now I'm getting a MemoryError
 
lol
@roganjosh what? no??
 
@12944qwerty yeah. dont worry about it.
primarily trying to emphasize why MCVE are important. and what makes an mcve actually "complete" and "minimal"
 
8:44 PM
@AndrasDeak hahaha, that cracked me up. Clever excuse.
 
AAB
@AndrasDeak the string is still not matching when I retrieve from DB and apply re.search().
 
@AAB I'm sorry you feel that way
 
AAB
@AndrasDeak so the issue is not in regex but the logic elsewhere :(
 
@12944qwerty Aran is not confused about coding in general. They posted that code to illustrate an issue in the logic of someone else. It wasn't a question that the room needed to answer; I'm quite confident of that
 
@AAB depends on how you look at it
 
8:47 PM
@roganjosh oh ok...
 
The regex is part of the logic, all we know is that there's at least one bug.
 
@12944qwerty If it had been a real question, I wouldn't have pinged a specific person with it :)
 
AAB
@AndrasDeak nope it's clear from your sample its not the issue the pattern is fixed, does not change, let me check.
 
@AAB You'd want to print(target) or even print(repr(target)) and then play with that exact data point interactively. You can call this debugging.
 
@AAB btw, this is why making smaller snippets is important. AD's sample is something you yourself can always create for yourself. If you have a problem, and you don't try to narrow it down, but keep running the whole thing over, you'll not be able to find what the issue is. Take steps to narrow it down.
 
AAB
8:54 PM
@ParitoshSingh Yes, seems like I got one thing stuck in my head and I keep trying to make it work without debugging properly.
@AndrasDeak thanks
@Aran-Fey I just realized how stupid my reply to ur question was... should have got the meaning from the question :P
 
Either your target is not what you expect it to be or your pattern has a shortcoming after all. Only you can find out.
 
AAB
@AndrasDeak yup may be sleep and look at it tomo (hope my brain works better :P )
 
00:00 - 21:0021:00 - 00:00

« first day (3841 days earlier)      last day (1090 days later) »