« first day (3384 days earlier)      last day (1556 days later) » 
03:00 - 20:0020:00 - 00:00

8:06 PM
is there any way to make electricity move faster? There's a good chance this might be an XY problem
 
First, reduce the ambient temperature of your room to 4 Kelvin.
 
hmm... can I reduce the ambient temperature of the room to 4 Kevin instead? We have them here
 
@inspectorG4dget not without changing the properties of the conductor I think
and if you have a semiconductor then you should not go down to 4 kelvins ;)
 
4 Kevins will not help you be more productive because they will notice they have the perfect number of players for a round of Magic: The Gathering, and immediately excuse themselves
 
@AndrasDeak that's unfortunate
 
8:10 PM
and yes, it has to be XY
what's your X?
if you don't mind the personal question
 
in other news, I just googled "semi conductor" and got the idea to write a symphony in which all the instruments are big rig trucks
@AndrasDeak /me reaches for my dating archive to find a picture of my X
X: file transfer is taking too long. It's a one-time data port, so I'm not too woried
 
yyyeah
 
recbg all
 
Hmm this algorithm I meticulously constructed works great on trees, but now that I squint at the requirements again, it has to work on arbitrary directed graphs.
Put simply, it's very good at finding X given Y = 2; X = Y+2 but it's very bad at finding B given A = 1; B = B/2 + A
 
If I'm implementing a Database object to provide a layer between my logic and whatever I'm using for a persistence layer, should the initial startup/connection to/verification of the database run in the __init__ for that object, or be run by a method on the object called subsequently? I'm thinking the later, but I'm open to other conceptions of what makes sense to run in an __init__.
 
8:28 PM
You could look at existing ORMs to see how they structure things. I've seen some that require an explicit connect method, and some that silently connect to the database the first time you query it
It wouldn't surprised me if there are some that open the connection during __init__
Trying to figure out what sqlalchemy does... If I'm reading docs.sqlalchemy.org/en/13/orm/tutorial.html#connecting right, there is an Engine.connect method you can use, but you're also allowed to call Engine.execute on your query without calling connect first and it will connect for you anyway.
In either case the engine returned by create_engine() appears to be initially in a "not connected" state, so I guess it doesn't subscribe to the "connect during __init__" model
 
I'm thinking more along the lines of what makes sense in an __init__ of the Database object I'm defining since a connection might not be necessary (in the case of my prototype app which uses JSON in text files, at all necessary beyond possibly verifying that the folders/paths it expects to exist are there), or might be established multiple times during the life of the object.
I guess what I'm thinking is something like a connection isn't going to be integral to setting up the Database object, so maybe it shouldn't be in the __init__ - but on the other hand one might expect it to happen there.
 
Does anyone know how you would find solutions to problems such as:
searchLabel.x < searchBox.x < searchButton.x
I want to find the solution 0, 1, 2
ORTools works with this problem, But I want to solve this problem with plain python code
 
I'm tempted to bring up Python's file object as a point of comparison. File objects can be both open and closed. The most expedient way to get a file instance is to call open, which effectively "connects" the object to your file system on your behalf
... But files and databases are apples and oranges, really
 
@Kevin ...completely ignorant of how this works, but I wouldn't be surprised if open() accesses already initialised access to the file system, unless that runs on completely different and separated code from that which might access the stdlib/interpreter (eg that used to read the open() function in the first place?
 
@user10662977 Solving exactly and only a sequence of "less than" operations is quite easy. Assign 0 to the first name, then 1 to the second name, etc.
 
8:43 PM
@toonarmycaptain I think you're doing this designing process backwards. Think about how you want to use your database, and then implement it in such a way that it works the way you're using it
If you need to create a connection in your __init__ then do it, if you don't need to then don't
 
>>> s = "searchLabel.x < searchBox.x < searchButton.x"
>>> for idx, name in enumerate(s.split(" < ")):
...     print(f"{name} = {idx}")
...
searchLabel.x = 0
searchBox.x = 1
searchButton.x = 2
 
I guess that works
Thank you
 
Well I can decide to have to call .establish_connection() explicitly, or have it run implicitly eg during __init__or if necessary as part of .get_data etc. I'm trying to think about whether that makes sense.
 
... Oh, I was expecting you to say, "cool, but I need it to be able to solve arbitrary arithmetic expressions of any form, for example x**3 + y**3 == z**3". That would be a little harder.
 
@toonarmycaptain The first thing you'd want to know is how many concurrent connections there are
Using JSON files almost certainly wouldn't approximate anything but a single client
 
8:47 PM
@toonarmycaptain But does an establish_connection() method make sense for your JSON-in-text-files "database"?
 
@Aran-Fey I'm writing a wrapper class that can be instantiated over a few different databases, starting with my quick and dirty JSON/text files, the SQLite, then maybe Postgres.
 
afternoon cabbage
 
I don't think there's a reason to force the user to create the connection explicitly. In fact, I wouldn't want to start all Database methods with if not self.connected: raise NotConnectedException. Why not just let the object be to ready to use as soon as it's created? That seems more convenient to use and write
 
@Aran-Fey Not specifically, but if I call a method that, I'd have it verify the filepaths exist that that model would need etc, similarly to how I'll have to have some code somewhere creating a new database if none exists, then maybe verifying the schema is what is expected etc.
 
@toonarmycaptain I'd be inclined to do the simplest thing that works. Connect exactly once in the __init__ and keep the connection open for the lifetime of the object. Later, when you come up with an excellent reason to have something fancier, that will be the time to change your design.
If you were hoping that I would have an excellent reason to do something fancier from the get-go, I'm afraid I lack the creativity
 
8:52 PM
@Aran-Fey Well that's my thought behind having that sort of code run in the __init__. But you are correct, I'm trying to think about design and architecture first. When I don't it results in messiness like my current task of unwinding filesystem calls from business logic, which in retrospect I should have done from the get go, as I did with UI and logic. :)
 
My inclination would be to start with SQlite and skip JSON. The entire dataset has to be read into memory each time, and while it's in memory you've just completely disconnected the two components on either side of your middleware. You either leave the file open and potentially have the file unmodifiable to another process, or you can actually read the file but the data is out of date
 
@roganjosh Maybe that would be better, but how I've got it is a file with a list of class names (as in first_period, second_period, most_annoying_period_ever_period, angelic_seventh_period), and separate datafiles for each class. Multiple process access hasn't been an issue yet, but I ought to support it because it's what's currently running.
 
What's in the datafiles? Can that fit into a tabular format too?
 
@roganjosh More or less, it's just python objects translated into dicts and saved as JSON.
Part of this exercise is to design a Database base class defining an API/methods that subclasses have to implement.
 
Ok, so SQLAlchemy is out of the window and the task is that you have to approximate it as an exercise?
 
9:01 PM
Maybe I'm biased because the majority of my projects die to analysis paralysis, and that's why I'm recommending just getting something working
 
The problem is that as soon as you hit what seems like an inevitable problem with JSON, there's nowhere to go without starting again
 
I guess my thesis statement is: you don't have to set your interface design in stone before finishing your alpha product, and it's not a failure if you change the interface later
 
SQLite does the check for you; if the db doesn't exist, it just makes it on connection. CREATE TABLE IF NOT EXISTS on every schema definition automatically fixes anything that might be wrong with the new db schema. It already handles multiple readers and the architecture is very close to postgres if they did get to their end goal. I can see the point on analysis paralysis but I'm not sure whether it tips the balance here
 
@Kevin Aha. Good reason why my first pass is to get a JSONDatabase(Database) object wrapping the current persistence layer working, before I write a SQLiteDatabase(Database) object and implement SQLite.
Ultimately it's only my wife using this at the moment, although ultimately I have a vague plan to run it first on her machine with a web frontend (rather than CLI), and then extend that to running on a server open to multiple users, at which point it will definitely not be running JSON as a persistence backend!
 
Eh, we've made our cases, it's up to you to decide :)
I'm also getting deja vu that we've had this discussion before, a month or two back
 
9:12 PM
@roganjosh are you sure it's not a glitch in the matrix? :)
 
This is a project I've been working on, off and on, for awhile, but I only decided to go this route on the weekend, so hopefully not with me ;)
 
@JonClements no, no I'm not. Which way to Zion?
 
left? No your other left!? :)
 
<looking in the mirror deciding which pill to take, and "left"/"other left" is doubly confusing>
 
lol... Friday's looking good... first episode of "Picard" on Amazon and then Season 3 of Sabrina on Netflix... rubs paws together...
 
9:17 PM
That, and Studio Ghibli has 21 films coming to Netflix starting next month
 
ahhh... haven't watched anime in ages
 
@roganjosh Really? Excellent.
@JonClements Picard? :D
 
@toonarmycaptain Yeah, they're staggering it over a month or so IIRC. I've seen a few, but there's definitely plenty that I've not seen. They're great for winding down before bed :)
@JonClements Have you watched Ex Machina on Netflix? That's a pretty decent film though the first 10/15 minutes is horribly rushed
 
I'm going to use some of them for nighttime for my kids. Much like old Disney movies, they'll either watch them, in which case, great, or go to sleep quickly, in which case, better.
 
@roganjosh good movie
Recent negative experience, probably the first negative with Netflix: Another Life. It gets dumber and more annoying with every episode :/
 
9:22 PM
@roganjosh I have - and a slightly curious ending...
 
@AndrasDeak ILand (or I.Land? I don't wanna give it more web traffic searching). I didn't know what to feel at the end. It was a rollercoaster of hilarity and crippling annoyance at how dumb the whole thing was :P
 
The trailer looked so ridiculous that we never gave it a chance
 
Hometime, rhubarb all :)
 
I made it through one episode. I cannot un-see it
rbrb toon
 
I thoroughly enjoyed See No Evil, Hear No Evil again the other week and also Coming To America again a few days ago...
 
9:27 PM
@JonClements The ending is the best bit :) (not because it's ending, though :P)
 
9:59 PM
Does anyone have opinions on Udemy courses? A guy at work in my Python "workshops", or whatever you'd call the partially-sighted ad-libbing to the blind, asked whether this looked any good. My instinct is that, for £12, what the heck, but it seems over-stretched in its promises
They also seem to be permanently on a mega discount that would put DFS (a sofa company in the UK) to shame
 
10:29 PM
Fun fact: constant discounts are illegal here
 
@AndrasDeak I'll try follow up on those because there's not a lot of info in the comments themselves
 
idjaw seems to like it
 
Fun fact: we can get around it by deliberately overpricing things for a while, as long as we put it on the advert. Also, there's a major retailer that launches products in a really obscure store at some stupid price so they can legit say "it used to cost this" even though basically nobody ever saw it at the original price and they knew it wouldn't sell :P
 
Well yeah, that works
Give it a few months and it'll be legal in the UK ;)
 
I simply can't wait.
@AndrasDeak Ha, ok, I'd been working my way though the comments to see if there was surrounding info. I read your message loud and clear now :)
At the very same time, I open FB and get this ad:
In the climate of all these courses just bombarding you, it's not so hard to see why so much garbage gets posted on SO. Hey, they're paying a bit to get the "unfair advantage" and we're all in this together, right?
 
11:30 PM
@roganjosh well the message was mostly "read the surrounding info, see if you find anything" :P
 
Yeah, the video was enough to assure me that it's as I assumed; not very good. I'm less concerned about the plagiarism (in terms of what is delivered to the purchaser) since that can be battled between the interested parties, but it suggests that the course deliverers don't have the knowledge to actually explain anything themselves
But, this guy bought it "as an early birthday present to himself" so I'm a) morally uncomfortable to turn it around (despite already saying I wasn't so convinced) and b) might be able to report back on some wacky stuff it teaches similar to LPTHW
 
I wouldn't be surprised if quality varied with lecturer
 
03:00 - 20:0020:00 - 00:00

« first day (3384 days earlier)      last day (1556 days later) »