Categories
Development

Gmail displaying plain text instead of HTML

Situation I have a script that is downloading emails from a Gmail account, tweaking the content, and re-sending out the emails. Problem Whenever I create an email with an embedded image, Gmail displays the plain text version of the email and the embedded image appears like a regular attachment. Tested If I use a different […]

Categories
Development

How can I get IMSC XML from an HLS manifest?

I am reading about IMSC and the docs say it should be in XML https://developer.mozilla.org/en-US/docs/Related/IMSC Meanwhile, I have an RTMP stream with embedded caption data from the HLS manifest. When I look at the fragments, it all looks like binary to me rather than XML. I actually checked all network traffic from the browser and […]

Categories
Development

mapbox direction or optimization api (how to avoid tolls/bridges/.e.t.c)

I am using mapbox and leaflet and leaflet plugin. I have a very simple question. I’d like to have the option to avoid tolls/bridges/.e.t.c by passing the specific option. Is this possible ? I’ve seen that for mapbox swift , it’s possible, but i don’t see anything mapbox api has something like this for Directions/Optimization […]

Categories
Development

How can I use npm-plugins with react-chartjs-2?

I use react-chartjs-2 with chartjs in my app and I want to use chartjs-plugin-datalabels to display titles. How can I register this plugin in react-chartjs-2?

Categories
Development

Java 8: Class.getName() slows down String concatenation chain

recently I’ve run into an issue regarding String concatenation. This benchmark summarizes it: @OutputTimeUnit(TimeUnit.NANOSECONDS) public class BrokenConcatenationBenchmark { @Benchmark public String slow(Data data) { final Class<? extends Data> clazz = data.clazz; return “class ” + clazz.getName(); } @Benchmark public String fast(Data data) { final Class<? extends Data> clazz = data.clazz; final String clazzName = clazz.getName(); […]

Categories
Development

How to reverse a number in assembly language (8086)?

I am unable to find a way to reverse a number from an array in assembly. Even after thinking for hours i can’t find a solution. I want to reverse a number if its greater than -50. If its 24 it becomes 42 and if its -15 it becomes -51 Following is some part of […]

Categories
Artificial Intelligence (AI) Development

Designing a reinforcement learning AI for a game of connect 4

I’ve made a connect 4 game in javascript, and I want to design an AI for it. I made a post the other day about what output would be needed, and I think I could use images of the board and a CNN. I did some research into Reinforcement learning, and I think that’s what […]

New 18.04 using 2 GB of RAM

I have a 4GB RAM laptop. During last week, my system was freezing a lot. When I checked the stats, it said 2 GB or RAM and 1 GB cache is in use. The load is some 1.2 or similar. So I reinstalled 18.04 and a couple of regular programs. But even with everything closed, […]

Categories
CMS Development Wordpress

Incorrect post_type in url of taxonomy term

I have registered a custom post type oa_location with custom menu (using show_in_menu) and a taxonomy called oa_country. These two connected but because our CPT placed in a custom menu, there is a problem in url of taxonomy term: http://localhost/demo/wp-admin/term.php?taxonomy=oa_country&tag_ID=46&post_type=post&wp_http_referer=demo/wp-admin/edit-tags.php?taxonomy=oa_country my code to register this CPT: $arg = array( ‘label’ => __(‘Post Type’, ‘text_domain’), ‘description’ […]

Categories
Development

memo doesn’t detect the changes in the props pass into the component

I’m using the useMutation hook from Apollo GraphQL and I want perform a certain task using the onCompleted property. Bascially, I want to execute the setCheck() hook when the useMutation is successfully completed and pass the check state as a prop to the child component const ParentComponent = () => { const [ check, setCheck […]