Categories
Mastering Development

Win32 Listview Iconview Top-Offset

I am looking to have a top-offset of 20 pixels in a Listview relative to the first item in the listview. The offset initially appears to work fine (see Listview 1). However, once the scrollbar appears, the offset is no longer visible (see Listview 2). I want to be able to scroll up into the […]

Categories
Mastering Development

Stop script chrome extension from runing when varaiable meets required criteria

i created an extension in chrome, when i activate the extension it runs the content.js script once every two seconds looking for an specific value in a page that is constantly changing. This is my background.js: chrome.browserAction.onClicked.addListener(buttonClicked); function buttonClicked(tab){ let msg = { txt: "hello" } window.setInterval(function(){ chrome.tabs.sendMessage(tab.id, msg); }, 2000); } And this is […]

Categories
Mastering Development

How to fetch values from an incoming WhatsApp message on a Flask application using Twilio?

So I am trying to create a Flask Application (TwiML) that will read the incoming WhatsApp message and store its details in a PostgreSQL database. Here is how my Flask application looks like: from flask import Flask, request from twilio.twiml.messaging_response import MessagingResponse import psycopg2 app = Flask(__name__) @app.route(“/sms”, methods=[‘GET’,’POST’]) def sms_reply(): msg = request.form.get(‘Body’) text_status […]

Categories
Mastering Development

How can I remove an object from array in python?

How can I remove an object from array in python? I want to select an msgID and want to delete that full object with username, msg, time_stamp (all of it). room_msg = [ { ‘msgID’: 1, ‘username’: ‘User1’, ‘msg’: ‘msg1’, ‘time_stamp’: ‘May-31 05:29PM’}, { ‘msgID’: 2, ‘username’: ‘User2’, ‘msg’: ‘msg2’, ‘time_stamp’: ‘May-31 05:29PM’}, { ‘msgID’: […]

Categories
Mastering Development

How to save the user setting by using SharedPreferences?

I made NotificationsActivity and I put 2 menu items to enable or disable receiving the notifications. When I changed the setting, and the notificiton become off, when I closed the activity and come back, it show notification on button, I have used SharedPreferences to save the setting in my app, but it did not work. […]

Categories
Mastering Development

multithreading problem in boost asio example

I’m developing a tcp service, and I took an example from boost asio to start (https://www.boost.org/doc/libs/1_73_0/doc/html/boost_asio/example/cpp11/chat/chat_server.cpp), and I’m worried about something, as I understand, any time you want to send something you have to use the deliver function that check the status of and run some operations over the write_msgs_ queue (in my code write_msgs_ […]

Categories
Database Development

Explaining recurring crash in postgresql deployment

I’m having trouble with unexpected system crashes emanating from a postgresql deployment on a moderately busy production server (Django 1.8 app deployed on DO droplet with a gunicorn application server and nginx reverse proxy). I’m an accidental DBA and need an expert’s opinion on piecing together what’s going on. I have no clue right now; […]

Categories
Linux Mastering Development

Error with Keyring when connection from ssh

Due to COVID-19 we are working from home. Now I have a linux (Ubuntu) pc at my workplace which has TortoiseHG Workbench installed. I connect via MobaXTerm to my computer over ssh. Normally when I try to update the repo it works due to the password and user is saved in the keyring. Now when […]

Categories
Mastering Development

Application has Stoppped (Android Studio Bluetooth)

I try to make communication between two devices by using Bluteooth but always the application stopped when i try to test it. I just try to send simple string (for exemple ‘A’) but also I have errors. Also i can’t turn on/off bluetooth manually. the error is : Caused by: java.lang.NullPointerException: Attempt to invoke virtual […]

Categories
Mastering Development

Primefaces rwoEditor returns old data

i am a new in primefaces and ajax Iam using primefaces 8.0, payara 5.193, jsf2.2 .I tried to implement primefaces showcase datatable rowediting. But when i validate the updated value into the datatable, i get the old value. This is my code. categoryindex.xhtml <h:form id=”form”> <p:growl id=”msgs” showDetail=”true”/> <h1><h:outputText value=”List”/></h1> <p:commandButton value=”Add Category” type=”button” onclick=”PF(‘dlg1’).show();” […]