Categories
CMS Drupal Mastering Development

Drupal 8 language code and country code on the URL

I’ve been trying to achieve this: I have a multilingual site with 8 languages (en, fr, es, de, etc) and I want to make all those language available for all countries. I want Drupal to understand that: /en-CO alias of /en /en-FR alias of /en /es-US alias of /es /es-AR alias of /es /fr-CO alias […]

Categories
Mastering Development

rotate dataframe with header – R

How can we change or rotate the dataframe to be like the example below (First line represents a header)? State1 Customer1 State2 Customer2 State3 Customer3 State4 Customer4 Us 1980 FR 274 DE 641 UK 521 Script: State <- c(“US”, “FR”,”DE”, “UK”) Customer <- c(1980,274,641, 521) Table <- data.frame(State, Customer)

Categories
Linux Mastering Development Ubuntu

alsamixer USB Headphone/MIC combo cannot control mic

I have attempted everything i have been able to scour the internet for and am at a loss. HyperX Cloud Flight S headphones will not allow me to use the mic whereas their previous non-s revision works perfectly. Here are some relevant outputs: uname -a Linux laptop 5.3.0-42-generic #34-Ubuntu SMP Fri Feb 28 05:49:40 UTC […]

Categories
User Help

OperationalError at /admin/products/product/add/ no such table: main.auth_user__old DJANGO [closed]

main.auth_user__old in django tutorial going through mosh created a web server.When saving some polls or products or set i get this error instead of going to be saved on the site. Heres the error OperationalError at /admin/products/product/add/ no such table: main.auth_user__old Request Method: POST Request URL: http://127.0.0.1:8000/admin/products/product/add/ Django Version: 2.1 Exception Type: OperationalError Exception Value: […]

Categories
Mastering Development

Merge array with previous value (under defined conditions)

Here’s the initial table’s structure : yearquarter,user_id,gender,generation,country,group_id 2019-03,zfuzhfuzh,M,Y,FR,Group_1 2019-04,zfuzhfuzh,M,Y,FR,Group_1 2020-04,zfuzhfuzh,M,Y,FR,Group_1 2019-03,ggezegz,F,Y,FR,Group_2 2019-04,ggezegz,F,Y,FR,Group_2 2020-04,ggezegz,F,X,FR,Group_2 …. I want to be able to know the cumulative amount of user_id quarter after quarter grouped by gender, generation and country. Expected result: for a given combination of gender,generation,country I need the cumulated number of users quarter after quarter. I started […]

Categories
Mastering Development

How to ensure latest search results are fetched in a live Ajax search

I am trying to build a live AJAX search box. I am using keyup() function to trigger the search api with the current value of the input box as the search-text. However since the search api calls are asynchronous there is no guarantee that the final api call will be the one that is rendered […]

Categories
Development

Fullcalendar recurring event with rrule is not working

I am using fullcalendar 4.4.0 and everything working fine except rrule. If i try with simple recurrence, it is working, but rrule recurrence not working. let me share my code <script src=”https://unpkg.com/@fullcalendar/rrule@4.4.0/main.min.js”></script> <script src=”https://unpkg.com/@fullcalendar/core@4.4.0/main.min.js”></script> <script src=”https://unpkg.com/@fullcalendar/interaction@4.4.0/main.min.js”></script> <script src=”https://unpkg.com/@fullcalendar/daygrid@4.4.0/main.min.js”></script> <script src=”https://unpkg.com/@fullcalendar/timegrid@4.4.0/main.min.js”></script> <script src=”https://unpkg.com/@fullcalendar/resource-common@4.4.0/main.min.js”></script> <script src=”https://unpkg.com/@fullcalendar/resource-daygrid@4.4.0/main.min.js”></script> <script src=”https://unpkg.com/@fullcalendar/resource-timegrid@4.4.0/main.min.js”></script> <scritpt src=”https://unpkg.com/@fullcalendar/moment@4.4.0/main.min.js”></scritpt> <script src=”https://unpkg.com/@fullcalendar/interaction@4.4.0/main.min.js”></script> <script src=””></script> The code for […]

Categories
CMS Development Drupal

Drupal 8 external content migration translation problem

I am trying to import content into Drupal 8 from an external source (not previous Drupal version). I have crawled the original site and placed the content in a database. I am then writing a custom module to bring it into Druapl. I have the default language as English so when I run the migration […]

Categories
Development

ASP.Net Core exclude published language directories other than english

I publish my ASP.Net Core 3.1 Server like this: dotnet publish –configuration Release –runtime win7-x64 -p:PublishTrimmed=true –output c:\MyServer What I get in c:\MyServer is a lot of international language directories: cs, de, es, fr, zh-hans etc How can I publish with only the English version ? I tried using ExcludeFoldersFromDeployment in my csproj: <PropertyGroup> <TargetFramework>netcoreapp3.1</TargetFramework> […]

Categories
Development

Matplotlib: Add color legend to scatter plot

Have table as: import matplotlib.pyplot as plt import pandas as pd import numpy as np list_1=[[‘AU’,152,474.0], [‘CA’,440,482.0], [‘DE’,250,564.0,], [‘ES’,707,549.0,], [‘FR’,1435,551.0,], [‘GB’,731,555.0,], [‘IT’,979,600.0,], [‘NDF’,45041,357.0,], [‘NL’,247,542.0,], [‘PT’,83,462.0,], [‘US’,20095,513.0,], [‘other’,3655,526.0,]] labels=[‘country_destination’,’num_users’,’avg_hours_spend’] df=pd.DataFrame(list_1,columns=labels) df=df.set_index(‘country_destination’) df country_destination num_users avg_hours_spend AU 152 474.0 CA 440 482.0 DE 250 564.0 ES 707 549.0 FR 1435 551.0 GB 731 555.0 IT 979 600.0 […]