Categories
CMS Joomla Mastering Development

How to compare current date to article created date?

I need a code to compare if current date and time is greater than article created time of joomla. I have this example code: function CompareDate() { // new Date(Year, Month, Date, Hr, Min, Sec); var dateOne = new Date(2020, 03, 20, 11, 00, 00); var dateTwo = new Date(2020, 03, 20, 12, 00, 00); […]

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
Development

Extraction datas from forms

I’ve just start to learn Django and now I’m trying understand how to insert datas in db, how to work with datas from templates and ect. My question is about extracting datas from form(Meta class) in template. Here is my code: model class Worker(models.Model): POSITION_SHOICE = ( (‘MANAGER’, ‘MANAGER’), (‘developer’, ‘DEVELOPER’), (‘teamlead’, ‘TEAMLEAD’), (‘pm’, ‘PM’), […]

Categories
Development

Symfony – XXX is not a constructor

I am trying to install Jodit (https://xdsoft.net/jodit/doc/) on my Symfony project I use webpack-encore, so, in my app.js, I added: // Jodit const Jodit = require(“jodit”); global.Jodit = Jodit; And in my template : <script> var editor = new Jodit(‘#message_content’, { “minHeight”: 200, “showCharsCounter”: false, “toolbarAdaptive”: false, “showWordsCounter”: false, “showXPathInStatusbar”: false, “defaultActionOnPaste”: “insert_clear_html”, “buttons”: “bold,italic,underline,strikethrough,|,ul,ol,|,font,fontsize,|,image,video,table,link,|,left,center,right,|,hr,symbol,|,undo,redo” […]

Categories
Development

Shiny App: Cannot Generate the Correct Plot with ggplot2

The solution to my problem must be a one-liner, but I am making my baby steps with shiny. Please consider the example at https://shiny.rstudio.com/gallery/telephones-by-region.html Which I have modified so that it uses ggplot2 to generate the plot (and a scatterplot instead of a barplot). I paste the code below. Obviously there is a bug since […]

Categories
Development

Getting Duplicate Labeled Points on Scatterplot in R

I am trying to use kmeans to show what states have similar statistics with one another from the Lahman database, my code is as follows: battingInfo <- Batting %>% filter(yearID >= 1999) total <- merge(battingInfo,People,by=”playerID”) totalN <- total[,-c(24,25,28:47)] filterByState <- totalN %>% group_by(birthState) %>% summarise(players = length(playerID)) newMerge <- merge(totalN, filterByState, by=”birthState”) newTest <- newMerge […]

Categories
Development

spark: save ordered data to parquet

I have 30TB of data sorted by date and hour, split into 300 files each hour. I do some data conversion & then want the data sorted and saved in the sorted order for easy ingestion by a C++ program. I understand that when you serialize, the ordering is only correct within a file as […]

Categories
Development

Adding tuples to lists in nested dictionaries

I would like to add a tuple to a list for data that I already have in a nested dictionary format if it is missing. all_cap = {“cap_1”:{“id”:1001, “vitals”:[(“Temp”, 101), (“HR”, 60)]}, “cap_2”: {“id”:1002, “vitals”:[(“Temp”, 104), (“HR”, 60), (“RR”, 12)]}} So, if I went to add a tuple (“RR”, 16) to cap_1 it would work, […]

Categories
Development

Pivot by group for unequal data size

I have the following DF: DF = structure(list(ID = c(21785L, 21785L, 21785L), V1 = c(0.828273303, 6.404590021, 0.775568448), V2 = c(2L, 3L, 2L), V3 = c(NA, 1.122899914, 0.850113234), V4 = c(NA, 4L, 3L), V5 = c(NA, 0.866757168, 0.868943246 ), V6 = c(NA, 5L, 4L), V7 = c(NA, 0.563804788, 0.728656328), V8 = c(NA, 6L, 5L), V9 = […]

Categories
Development

How to execute two different ResultSet Objects in the same method

I’m running the JDBC with Oracle database, but when it come to execute queries on the same method it noes not execute the second. public class PRACTICE_4 { public static void main(String[] args) throws SQLException,ClassNotFoundException{ Scanner scn = new Scanner(System.in); String url = “jdbc:oracle:thin:@//localhost:1521/xe”; Connection con = DriverManager.getConnection(url,”hr”,”oracle”); PreparedStatement statement = con.prepareStatement(“SELECT e.first_name, e.last_name,d.department_name,l.city \n” […]