« first day (4423 days earlier)      last day (508 days later) » 

4:16 AM
@sahasrara62 I added another dupe target & hammered it. But that bitstring is strange.
 
 
4 hours later…
8:00 AM
@PM2Ring yeah with using error='replace' it is showing strange bit string, probably need to make custom decoder there or error handling cases
 
8:57 AM
dpaste.org/H9GFp here is my code where I want use my service_register() for testing... can anyone guide me how to call for response in this( I don't want to use test_client as I've already done testing using the same).
 
9:26 AM
 
 
1 hour later…
10:27 AM
Hi everyone.
how can I find any information about Horizontal and Vertical DB searching?
 
10:39 AM
#does it look like a json?
[{"c1": 11, "c2": 22}, {"c1": 99, "c2": 88}]
is it a json? or simply a list of dict?
 
https://jsonlint.com/

You can check that here
 
11:05 AM
@discoMonkey both. It's a JSON representation at the moment because of the double quotes but the distinction isn't really important
a = [{"a": 1}]
print(a)
 
@discoMonkey dict can be interpreted as json yes. But what you're showing here are two dict inside a single list
 
You'll see that it gets converted to single quotation marks around the key
 
11:18 AM
Does anyone have info about my question above? please
 
I don't even know what the question is supposed to mean? Like vertical and horizontal as in row or columns in a table? Or like DB parallelization vertically or horizontally and how to search in such clusters?
 
@JoraKaryan I assume you mean something like this? : stackoverflow.com/questions/22444585/…
 
@NordineLotfi oh thanks bro. It's useful.
 
11:47 AM
There are also columnar databases like redshift where the internal methods of record retrieval are different. It really is a broad question
 
12:04 PM
I have a python package that communicates with servers in multiple languages. These servers I actually bundle with the package. For Java it's fine, I can just shove the JAR in with the package and then launch it through a click CLI command. I want to the same with a rust server but this is more tricky - it needs to be compiled when you install the python library, but this is somewhat heavy so it would be good to have this as an optional step
In this case, the server to compile is self-contained - nothing in the python library calls into it. The CLI just spins the server up that happens to be bundled with it. It's not clear to me how I can call cargo to basically compile an entirely different project inside setup.py. Is it possible to run some shell commands with setuptools? Is this even the best way?
 
seems like pips version of optional dependencies is called extras stackoverflow.com/questions/6237946/…
so I'd say you can just add it as a seperate package that is an "extra"
 
an extra denotes a group of pip-installable python packages, not arbitrary artifacts. @roganjosh why an optional step? because otherwise the click command that starts the server wouldn't work?
 
Because the rust compilation step is somewhat heavy and the library can default back to the Java server (they're different libraries that do almost the same thing). So the click command could throw and error if you tried to launch the rust server, if you chose not to install it as an option
The problem is that I can't (I don't think) just include a rust binary like I can a JAR file because it will be installed on different OS's
 
can you distribute it as a wheel?
 
"not arbitrary artifacts" is the point I think I have been thinking. Am I trying to get pip to do too much here and instead, I should just rely on the user downloading and compiling the rust server entirely separately, and then just shout if I can't communicate with it?
 
12:17 PM
lots of options here
 
I vaguely recall there some packages on pip that call local compilers (eg: on Linux) to compile the needed libs for the python library.
I don't remember their name though, but I'm sure this could provide you with some ideas
 
1: put the cargo code into your setup.py. I've never done something like that personally, but I don't see how it could be "wrong" wrong
1.1: build wheels for all your target platforms which have the right rust binary. requires an internal pyPI for distribution and maintaining a potentially complex build pipeline
1.2: same as step 1, but you don't build the wheels yourself and just distribute a source package and let your users be your build pipeline. will fail if users don't have cargo
2: similar to 1.2, put the cargo code into a click command instead. might be better design wise, keeps you
 
ah, found one: github.com/simonpercivall/orderedset this one call gcc to compile the C part of the project.
 
they exist for rust too: github.com/ijl/orjson, but such a solution would be very involved, and imo way too much work if we're talking about a simple cli
 
Indeed, there are also things like maturin but that's for rust extensions rather than entirely separate entities. I like (2) @Arne, I hadn't thought of it that way, thanks!
 
12:33 PM
Meaning, these two projects build binaries that provide python bindings so that you can call their api directly from your python code without the overhead of subprocess. Since roganjosh said that they don't need to call the rust server at all, it would provide no value over just building the binary with the language's toolchain (read, javac or cargo)
Right, orjson uses maturin, and I used a long paragraph to describe "extension" ^^
@roganjosh Cool, I think that's what I would've done too
 
While I was trying to conceptualise the build, I was thinking "Telling PIP 'btw, while you're downloading this, could you just pull and compile this entirely different repo?'" is dodgy as yam, so I couldn't see it being very well supported
Then again, PIP ... :D
 
might not be best practice, but it sure is supported :p
 
12:56 PM
@Arne ah, you're right :o
but isn't click running subprocess anyway? for (2)
I'm probably just being slightly pedantic, if so don't mind what I said...
 
@NordineLotfi yeah it would, it's the right thing to do here. I probably wasn't very clear in my explanation
 
I think what you meant to tell me is that click is a better abstraction than just using "raw" subprocess to handle the rust compiling part
or at least that's what I should have understood? yeah
ah yeah, I didn't think about the python bindings part (even though I mentioned it I think). Nevermind, got it
 
The point of the python library is that it gives a standard interface to a range of different solvers. Those solvers are in all different languages, so I wrap them all in a REST API in their native language so I can send the same* problem to them interchangeably. The Java case is easy because you just bundle it all up into an executable JAR - no compilation necessary. Then just subprocess launch the finished product
* they're not quite all the same. They have different heuristics and there's not a complete overlap in the constraints the solvers support
 
I see. That makes more sense then.
 
1:14 PM
Easier than trying to interface with them directly... until one of them needs compiling when you install the python interface :P
 
1:57 PM
Hi guys, I have a question regarding ASGI frameworks and webservers.
I have an async generator which "generates" a video file in parts. I am using Starlette as my web framework of choice. Currently I'm returning a StreamingResponse from Startlette.responses like this:
return StreamingResponse(stream_generator(), media_type='video/mp4')
The problem my webserver (uvicorn) does not let stream_generator fully generate the stream. I don't have a clue on why it's behaving this way. I'm guessing it's because stream_generator calls other functions which has asyncio.sleep(x) statements in it and for some reason, uvicorn is picking up those sleep statements???? and thinking of it as stream_generator has finished execution
 
2:32 PM
@NordineLotfi click isn't important to the overall issue, it just provides an alternative way to get the binary installed. to reiterate:
use case a): you have rust/c/non-python code in your repo that you want to call directly from your python code. language specific backends exist to compile them and provide bindings that you can import as if it were python code, no subprocess needed. usually done to implement algorithms where python would be slow. setting up the build backend (e.g. maturin) will be harder than the native build tools (e.g. cargo)
use case b): you don't get anything out of a deep integration with python bindings (e.g. your dependency's interface is good enough), and calling subprocess is fine too (e.g. only few calls where timing isn't critical), or there is no python build backend for your dependency's language -> bundle the binary into your package / include install code to get it on build or at runtime / crash and ask your user to install it somehow
 
yeah, use case (b) sounds better overall, especially because of the complexity of (a), among other things.
 
you only ever do a) if it provides a very significant benefit
 
yeah, for sure :)
 
 
8 hours later…
10:39 PM
My google fu is failing me. Does anyone know a way to enable markdown formatting in comments (in VSCode)? For example, if I write # **Important** it should render in bold
 
10:53 PM
My TODO list grows yet again...
 

« first day (4423 days earlier)      last day (508 days later) »