Categories
Development

Given a condition, modify values of a dataframe

I have a dataframe that contains codes with one letter and three digits maximum, ex: A478. Some codes only have one or two digits, but I need to put a point before all values that have three digits, to transform them in the form: A213 to A21.3 In short, I need to transform the df […]

Categories
Development

Persistent error… “The connection was not closed. The connection’s current state is open.”

I am trying to run the code behind a button in a WPF application that “updates” the employee information in the SQL Server database from the forms checkboxes and textboxes. I keep getting the error at the line “command.ExecuteNonQuery();” that the connection state isn’t closed, but I have tried everything. I’ve changed and added connection.Open(); […]

Categories
Development

Unit testing an async method containing a Timer

In .NET Core, background tasks are implemented as IHostedService. This is my hosted service: public interface IMyService { void DoStuff(); } public class MyHostedService : IHostedService, IDisposable { private const int frequency; private readonly IMyService myService; private Timer timer; public MyHostedService(IMyService myService, Setting s) { this.myService = myService; frequency = s.Frequency; } public void Dispose() […]

Categories
Development

Why can’t Eclipse find my ModuleA from within my ModuleB

I’m using Eclipse 20190614-1200, with gradle 5.6.2. I have several projects in my Eclipse workspace, each with their own module. They were all imported from a gradle (5.6.2) project with a subproject for each module. They’re generally in a foo.bar.<something> package, where the something varies as one would expect. package foo.bar.baz; // from module foo.bar.qux […]

Categories
Development

Running raw update query of mongo with mongoTemplate

I’m trying to update fields of embedded documents. Object that I want to update is “product” with “_id” : “5d7897cebc8ea8463c3e8d99” (deepest object in structure below in both “modifiers.values” objects: “modifiers[0].values[1].product.code” and “modifiers[1].values[2].product.code”). Let’s say to change “product.code” from “444” to “000000”. Running query with db shell is successfull, but with mongoTemplate it fails. This is […]

Categories
Development

How to hide soft keyboard after requesting keystroke with kivy in Android?

I used the kivy website example to create an app for Android that listens for a keystroke string. It works great, but as I am using it with scanners and scales the soft keyboard that pops up becomes unnecessary. I have tried all the different config settings as well downloading the app Null Keyboard. Update: […]

Categories
Development

SODA between operator does not work with some datasets

The between operator works for some Socrata SODA datasets and not for others. When used on certain datasets the query yields no results, but on other datasets it works as expected. What am I doing wrong? Instead of using between I tried using >= which did yield results. Also, I tried using between on a […]

Categories
Development

Is my leaf certificate truly invalid, or am I using `openssl verify` incorrectly?

I thought I created my leaf certificate (device.cert.pem) correctly but it’s not validating correctly with my software. I’m therefore trying to use OpenSSL on the command-line to verify said certificate before I debug my software any further. The chain is: root (CN=Halo HSM CA) signs signer (CN=Halo Signing Server 0003) signs device (CN=Halo). Here’s how […]

Categories
Development

How to pass an argument through the entire call chain? [on hold]

I need to pass an argument to the entire call chain. But I don’t know how to get it to works. def get_files() #Get a List of files #some code def get_hashes() files = get_files() #Hash the files from get_files #some code return hash_list def write_hashes() #Write the hashes from get_hahes hashes = get_hashes() #some […]

Categories
Database Development

Android Room database – when all rows are loaded

I am trying to use Android Room described there: https://codelabs.developers.google.com/codelabs/android-room-with-a-view-kotlin/#13 source codes: https://github.com/googlecodelabs/android-room-with-a-view/tree/kotlin/app/src/main/java/com/example/android/roomwordssample I would like to choose one record when all records will be loaded. I tried in the end of “onCreate(savedInstanceState: Bundle?)” function add this code: var rnd : Random = Random(System.currentTimeMillis()) var words : List<Word>? = wordViewModel.allWords.value // now wordViewModel.allWords.value is NULL […]