Skip Navigation

Hello,

I am trying to wrap some Rust code that uses sea-orm compiled with "runtime-tokio-rustls" feature. I am using the new pyo3 "experimental-async" feature, which AFAIK is based on pyo3_async.

So I get that this is supposed to be runtime-agnostic, and not have two event loops, one for python async and one for rust async.

But, how do I tell pyo3 to use tokio runtime specifically? Or, how do I set up Python asyncio eventloop to use tokio somehow?

Indeed, it seems that it does not use tokio runtime, so I get this error when I invoke the rust async function from Python: pyo3_runtime.PanicException: this functionality requires a Tokio context

3
Jump
Cargo env file?
  • Going opt-in instead of opt-out does not change the fact that I would still have to toggle the features manually. To be more specific, my use case is that I have a program to control cameras in my lab. But not all computers have the libraries for all cameras. So, every supported library can be enable/disable using a feature But the program being still in active development, I am frequently using cargo run, cargo check, cargo install, on different computers with different libraries installed. What would be convenient would be to have a configuration file on each computer, specifying that we will build only for PCO camera on this computer, only for Photometrics camera on this one, only Ximea and PCO on this one, instead of having to remember to toggle the relevant features every time. A shell script is not very convenient because I use different commands, run, check, install etc.

    1
  • Jump
    Cargo env file?
  • This would look like it would be what I am looking for, but the documentation of the configuration file does not mention features.

    2
  • Hello,

    I have a project for which some machines have only a subset of features set. Currently, I write cargo run --no-default-features --features "toto,titi" --bin my_bin

    This is a bit cumbersome and I sometimes forget the --no-default-features --features part. I was wondering if there is a local config file that I could put in the directory to instruct cargo to use this particular subset of features. I guess this should be in the documentation, but I didn't find it.

    11
    Jump
    Link against external DLL
  • Thank you very much for your reply. I have tried the approach you explain in your blog post, and it works. Your blog post is useful and clearly written !

    8
  • Hello,

    I am trying to use the SDK provided by the manufacturer of a camera from Rust. I use this in the build.rs :

    rust println!(r"cargo:rustc-link-search=C:\Program Files\Digital Camera Toolbox\Camware4"); println!("cargo:rustc-link-lib=SC2_Cam");

    However, it tries to find a .lib file, while the actual file is SC2_Cam.dll. I’ve tried specifying the kind as dylib=SC2_Cam but it makes no difference.

    Am I missing something obvious, or is it just not possible? Do I have to manually load the DLL at runtime with things like the libloading crate?

    3
    Jump
    Military Time vs 24hr?
  • I think I once read that when the metric system was first defined during the French Revolution, they also tried to use a decimal system for time, but that was quickly abandoned.

    6
  • Jump
    Reading advice after The Fall and Enigma Tales
  • Is there a full list of novels in this timeline ?

    I found Memory Beta First Splinter novels timeline, but it does not have all the novels. In particular, I can't find either "Collateral Damage" or "Time To" in the list...

    1
  • Jump
    Reading advice after The Fall and Enigma Tales
  • Thank you for the detailed and insightful answer. I'll bookmark it to decide on the next books to read.

    First, the Relaunch Treklit novelverse is a separate continuity from the new television series. I personally prefer a lot of the choices of major political arcs in the Relaunch timeline better than the new shows. Interestingly, the last season of Picard started to bring in some parallels from the books, despite being a very different future for Picard himself.

    OK good to know. So I can continue forward and not get spoilt. Does it mean that they have stopped writing for this timeline, now that the new shows are out ?

    Una McCormack has a few more Cardassia focused books. If you haven’t read them all yet, I’d suggest those given your preference for her book in the Fall. The book with Dr Pulaski is great and important but should be read after the Bashir S31 sequence if you’re going to do that.

    You mean Enigma Tales, and Neverending Sacrifice, or are there others ?

    the Voyager books advanced much more slowly through the timeline. I found the Christie Golden books exasperating (mainly due to the constraints out in her by the IP holder). When Kirsten Beyer took over and started the Full Circle sequence she was given freedom to fix many issues. It’s a great set of return to the Delta Quadrant books. Some recommend just starting with ‘Full Circle’ and going forward from there. Beyer takes about the first half of that book catching you up and moving things forward.

    As a matter of fact, I remember reading some of the earliest of those Voyager books (paper version). But it is so long ago that I could as well reread them now. What's "IP holder" ?

    2
  • Hello,

    In the recent years, I have had much less time available to watch new shows (I have a young kid). So I am quite lagging behind: I haven't seen PIC, nor the last season of DIS, nor SNW. I tended to not find the right moment to read books either. I finally started reading e-books and I realise how convenient they are to take advantage of 15 minutes of calm and discretly (and without noise) read a chapter or two. I used to read books on paper exclusively, and to find reading on screen difficult, but it turns out that I am now becoming an e-book reader and they allow me to spend much more time reading.

    So, I've started with Robinson's Stitch In Time because I heard a lot of good reviews. And it is indeed GREAT. Beautifully written. I wanted to read more, so I looked up what else Robinson had written, and bought "Prophecy and change Anthology". I read it entirely though I was initially interested only in "The Calling". But I was a bit disappointed as I found "The Calling" too esoteric for my liking. Nevertheless, I was eager to read more about Garak. So I bought and read "Enigma Tales" by Una McCormack, and it is AWESOME! Very well written. I like her writting style.

    I am aware that I am not reading in the proper order, but I then decided I wanted more from Una McCormack, so I read "The Fall: Crimson shadow". But I decided to read The Fall in order, so I read Revelation and Dust before. I liked "Revelation and Dust" much much less than Enigma Tales. The writer style is quite heavy, especially when it comes to describing female characters. But it was OK. "Crimson shadow" was AWESOME. I found the description of the transition towards democracy on Cardassia, and the challenge with the facist old guard trying to take back control by various demagogical means very well written. And with a lot of references to real world issues: Starfleet leaving Cardassia somewhat reminiscent of western forces leaving occupied countries in the middle east, the fascist rethoric of Cardassia First reminiscent of some policians IRL. This is SF like I like it: the reader escapes into the Star Trek world, and at the same time is invited to reflect on IRL issues (a bit like Persian letters).

    I was less impressed by the rest of the mini-series. The shenanigans on Andor were ok and I finally longed for the characters. But the conspiracy inside the Federation with the moustache-twirling villains that are Velk and Ishan made little sense to me. How could it be that the Federation which has existed for so long has so little counter-powers? How could an unelected person (president pro tempore) be allowed to wield that much power and make decisions without democratic oversight? Why do so many Starfleet personnels obey direct orders if this is illegal to do so? Why not telling him that he isn't authorized to issue them direct orders if that is so?

    The shenanigans made sense on Cardassia which was a military dictatorship for at least a century. It made sorta sense on Andor because of what they endured in their recent past and the dangers for their survival (though it was already far fetched that people would be so uninformed after 200 years in the Federation). To top it up, the last book (poisoned chalice) is much too predictable. You know the answer basically after the first few pages, and the story is just lagging. It almost felt like the author is just trying to fill pages (though I was still willing to keep reading until the end). There is also (I don't remember in which books in the mini series) all this discussion about Kira in the wormhole and things she experience there, but it is an unused Chekov gun. There are chapters about her, and then nothing.

    So my question is: what to read next? What are good series worth reading? Are there more featuring Garak? Is there a book with Kira coming back from the Wormhole? Do we get to see Crusher under Captain Ro on DS9?

    As I stated in introduction, I haven't been able to keep up with the new shows, and I don't want to get spoilt. So, I'd rather not go with books taking place after the events of PIC until I have had to opportunity to watch the shows (unless they don't spoil anyway).

    Any advice?

    6
    Jump
    Superconductor breakthrough replicated twice on preliminary testing
  • Keep in mind that superconductors have a critical current below which you have to be if you want to stay in the superconductive states. So for a superconductor to be useful for energy transport, this current has to not be tiny. I haven’t had the time to read their paper so I don’t know the value of the critical current. Also if for some reason the current suddenly goes beyond the critical current, the wire will heat suddenly, with possible damage…

    19
  • Jump
    Superconductor breakthrough replicated twice on preliminary testing
  • My understanding is that they also need low thermal noise to ensure pure states. They cool much below the superconduction threshold temperature (eg typically 20 mK). So I am not sure that this would be useful for quantum computers at the moment. Magnetic field productions such as that in MRI requires high current, so that depends on the maximum current that this material can sustain before that breaks superconductivity. So it could perhaps turn out useful or totally useless. Hard to say at the moment.

    5
  • Jump
    En Corse, face aux tags antifrançais, des touristes entre choc et incompréhension
  • Certains n'ont jamais abandonné leur langue (notamment dans la campagne), et adorent raconter comment ils étaient punis à l'école parce qu'ils parlaient breton. Mon beau-père rencontre régulièrement des gens dans les commerces, à la plage ou autre, et leur parle en breton. Et pas le breton appris de maintenant...

    2
  • Jump
    En Corse, face aux tags antifrançais, des touristes entre choc et incompréhension
  • Ma belle famille est totalement bretonnante. Mon beau père a appris le français à l’école (il a bientôt 70 ans). Je les entends parler breton et surtout utiliser le breton natif (versus celui appris en Skol Diwan) comme un shibboleth pour reconnaître le « vrai » breton du néo-breton. En tant que sudiste, j’ai bien senti plusieurs fois que j’étais quand même un estranger. Saint-Brieuc est un peu à l’est, à la limite du pays gallo. Plus à l’ouest ou dans les terres, il y a des bretonnants mais ils vont pas te le montrer forcément. J’ai constaté qu’il n’y a pas de volonté de transmettre la langue qu’il veut garder comme shibboleth. C’est très différent de mon expérience en Grèce où les amis m’ont appris beaucoup de culture et de langue, et avec joie et entrain. Je sais pas ce qu’il en est des corses, mais les tags mentionnés par OP me mettent mal à l’aise, mais je suis influencé par mon ressenti avec la belle famille bretonne.

    2
  • Jump
    France Descends into Authoritarianism Following Protests
  • I am not advocating for violence. However, it is not historically acurate to say that violence has no benefit. As a matter of fact, I can think of instances in the 18th, 19th and 20th century where violent protestors obtained rights or the end of some kind of oppression. I am not sure I can think of even one instance where anyone got anything without some kind of violence (or destruction of private property), even in the 20th century (there was violence in the May 1968 protests, or in the 1936 strikes, etc). The term "sabotage" itself has something to do with workers destroying the workshops by throwing their shoes (called "sabots") into the machine.

    6
  • Jump
    En Corse, face aux tags antifrançais, des touristes entre choc et incompréhension
  • Je comprends et en même temps j’ai l’impression que les gens sur ce genre de position ne voyagent peut être pas souvent. Je suis amené à voyager professionnellement (principalement en Europe mais un peu au delà aussi). Quand je vais une semaine en congrès en Pologne, République Tchèque, Autriche, Finlande, Suède, Japon, Chine, Hong Kong, etc pour rencontrer des collègues d’encore d’autres pays, je suis censé apprendre toutes les langues ? En pratique, j’essaie effectivement de le faire, mais c’est quand même un niveau d’exigence assez élevé. Et tout le monde n’est pas passionné de langues. Je connais quelques mots de grec, mais je passe quelques jours en Italie sur le chemin. Je suis illégitime à rester quelques jours en Italie si j’apprends pas l’italien ? Je suis pas contre le régionalisme lorsqu’il est inclusif (cf La Découverte ou L’ignorance de Tri Yann pour une culture et identité bretonne inclusive et ouverte). Quand c’est un voile pudique pour cacher de la xénophobie 🤮 J’ai déjà croisé des touristes étrangers qui ne parlent pas français, j’ai toujours essayé de leur répondre dans mon meilleur anglais, parce que je sais ce que c’est d’être perdu dans un pays étranger.

    5
  • Jump
    France Descends into Authoritarianism Following Protests
  • Riots like these are what you get when you prevent any other forms of protests: banning protests (illegal but by the time you get through court to get the ban lifted it is too late), making unions and strikes irrelevant by never ever yielding, preventing votes in the National Assembly using pressures on MP and all that the means that our constitution allows to bypass parliament, even though there is no clear majority for whatever you are doing, forcefully removing peaceful protestors, etc There are reasons why unions was good for everyone, elite class included, they allow peaceful resolution of conflict. If you remove all peaceful avenue, there will be people going into the not peaceful avenue.

    14
  • Jump
    En Corse, face aux tags antifrançais, des touristes entre choc et incompréhension
  • À peu près autant que les gens qui apprennent le provençal avant d’aller en Provence. Jamais vu de tags de cette nature en Provence par contre. En Bretagne un peu mais nettement moins. Jamais vu non plus de touristes apprendre le breton. Ou le basque. Ou le chti. En ce qui me concerne j’ai renoncé à aller en conf à Cargèse à la fois pour des raisons écologiques (une conf sur une île, quoi de pire?) et parce que j’ai pas envie d’aller dans un endroit où je ne suis pas bienvenue. Je serai favorable à ce que le CNRS ferme le centre de Cargèse. Mais que les corses se rassurent, avec le réchauffement climatique, les touristes iront plus au nord.

    17
  • Jump
    *Permanently Deleted*
  • I have a second-hand iPhone 7, my wife has an iPhone 6s. Neither supports iOS 16. The iPhone 7 was discontinued in 2019. I try to keep things for as long as possible for ecological reasons, eg most of the carbon footprint lies in the manufacturing and recycling. Besides, I don't use the phone for gaming, which might be a reason why I haven't noticed it being particularly slow (unlike my previous phone which was a iPhone 4s and was getting significantly slower over time).

    1
  • Americans of Lemmy, Happy Independence Day!

    I don't know if this is the right place for this. Cheers.

    2