Categories
Mastering Development

Splitting columns into rows from a text file using unix shell script – Dynamically changing source file structure

I’ve a tab seperated source file with this structure: Only the first 9 columns from ID to Line Item/Property is fixed, rest are all dynamic varying in count and structure. ID Date/Time (UTC) User Description Security Change Previous Value New Value Module/List Line Item/Property Scenarios Region EM2 Plan Item PB6 Market EM4 Plants – Master […]

Categories
CMS Magento Mastering Development

Include prompt widget in the mass action from Magento 2

My goal is to include a promp widget before choosing an option value from the mass action from the product grid. Here is my code so far: Vendor/ProductBarcode/view/base/web/requirejs-config.js : var config = { mixins: { ‘Magento_Ui/js/grid/massactions’ : { ‘Vendor_ProductBarcode/js/grid/massactions’: true } } }; Vendor/ProductBarcode/view/base/web/js/grid/massactions.js: define(function () { ‘use strict’; var mixin = { _init: function […]

Categories
Mastering Development

How to implement reminders using SQLite database in android studio

Im making an app which will trigger reminders for particular times which are saved in SQLite database.I tried doing it through Alarm Manger but the notifications are not visible on Android version greater than 22. Please help me out how to implement reminders or any other way to do it. public class ReminderAlarmService extends IntentService […]

Categories
Artificial Intelligence (AI) Mastering Development

How can I make my deep Q learning agent more robust?

I am learning deep Q learning. I created the code below, where the standard and the target Q functions use the same network and there’s no replay memory. import gym import numpy as np import torch.nn as nn import torch.nn.functional as F import torch.optim as optim import torch as T class LinearDeepQNetwork(nn.Module): def __init__(self, lr, […]

Categories
Mastering Development

SparkSession is not accessible inside foreach method of pyspark structured streaming

I am trying to access Sparksession inside foreach method of pyspark structured streaming ,but as this method works on worker nodes ,so unable to access. My Final goal is to get the single column from row object and compare the values of dataframe got from sql db and create a temp table of the result, […]

Categories
Artificial Intelligence (AI) Mastering Development

Ive created a deep q network. My model does not get better, and cant see what im doing wrong. Im new to RL

Replay Memory class ReplayMemory(object): def __init__(self, input_shape, mem_size=100000): self.states = np.zeros((mem_size, input_shape)) self.actions = np.zeros(mem_size, dtype=np.int32) self.next_states = np.zeros((mem_size, input_shape)) self.rewards = np.zeros(mem_size) self.terminals = np.zeros(mem_size) self.mem_size = mem_size self.mem_count = 0 def push(self, state, action, next_state, reward, terminal): idx = self.mem_count % self.mem_size self.states[idx] = state self.actions[idx] = action self.next_states[idx] = next_state self.rewards[idx] = […]

Categories
Database Development

How do I manipulate date in SQL server?

SELECT [ORG_ID], [BUSINESS_UNIT_NAME], [MESSAGE_ID], [MESSAGE_NAME], [DEPLOYMENT_ID], [DEPLOYMENT_NAME], [SMS_ID], [SMS_NUMBER], [ACTION_TIMESTAMP], [CUSTOMER_KEY], [CARRIER], [LINK_NAME], [LINK_URL], [SERVICE_ID], [ACTION], [EVENT_TYPE], [CLIENT_ID], [CAMPAIGN_ID], [CAMPAIGN_NUMBER], [CONTACT_ID], [EMAIL_ADDRESS], [ISO_CODE], [POSTAL_CODE], [STATE], [ADD_DATE], [SOURCE], [UPDATE_DATE], [UPDATE_SOURCE], ‘CONTACT_ID DOES NOT EXISTS IN THE DATABASE’ as REASON FROM [dbo].[SMS_ACTY] WHERE CONTACT_ID NOT IN (SELECT CONTACT_ID FROM CONTACT) and cast(add_date as date) = CAST(@run_id AS […]

Categories
Artificial Intelligence (AI) Mastering Development

Representation of state space, action space and reward system for RL porblem

I am trying to solve the problem of an agent dynamically discovering(start with no information about the environment) the environment and to explore as much of the environment as possible without crashing into obstacles I have the following environment: where the environment is a matrix. In this the obstacles are represented by 0’s and the […]

Categories
Artificial Intelligence (AI) Mastering Development

Representation of state space, action space and reward system for RL porblem

I am trying to solve the problem of an agent dynamically discovering(start with no information about the environment) the environment and to explore as much of the environment as possible without crashing into obstacles I have the following environment: where the environment is a matrix. In this the obstacles are represented by 0’s and the […]

Categories
Artificial Intelligence (AI) Mastering Development

Representation of state space, action space and reward system for RL porblem

I am trying to solve the problem of an agent dynamically discovering(start with no information about the environment) the environment and to explore as much of the environment as possible without crashing into obstacles I have the following environment: where the environment is a matrix. In this the obstacles are represented by 0’s and the […]