Categories
Development

Empty merge conflicts

Sometimes, when I do git pull origin master from a local branch, I get merge conflicts like: <<<<<<HEAD ====== >>>>>>xxxxxx How to avoid that ? Maybe it is due to some white spaces, so I tried to put a .gitattributes file containing * -whitespace but that didn’t solve the problem.

Categories
Development

How to manage “versions” of documents in elasticsearch?

Sometimes, I will have a new set of documents that will “replace” an old set of documents. I would like to still have access to the old set of documents for historical data analysis. However, I would like to primarily be only searching the new set of documents. One solution to this problem appears to […]

Categories
Development

Static class/values available only for current connection/user

I have Asp.NET core 2.I’m using a static class to keep some info available about current user (accessible in all controllers,etc),but seem to me,sometimes,static values from a user are visible to another.how to make static values available only for current connection/user? public static class globalVariables { public static string Value1; public static string getUserValue1().. { […]

Categories
Development

Update configuration for actively used index without data loss

Sometimes, I need to update mappings, settings, or bind default pipelines to the actively used index. For the time being, I am using a method with data loss as follows: update the index template with proper mapping (or binding the default pipeline by index.default_pipeline); create a_new_index (matching the template index_patterns); reindex the index_to_fix to a_new_index […]

Categories
Database Development Ruby

How to save variable without using database in ruby

Currently I have some code like this class WorkingWithThread def self.start_first_thread @@first_thread = Thread.new do do something repeat # infinitive loop end end def self.start_second_thread @@second_thread = Thread.new do do something repeat # infinitive loop end end def self.stop_thread begin Thread.kill @@first_thread Thread.kill @@second_thread p ‘STOP THREAD’ rescue Exception => e p ‘NO THREAD OPENING’ […]

Categories
Development MySQL SQL

Get count of continuous dates in mysql

I have a requirement to get count of continuous dates in leaves table. CREATE TABLE leaves( id INT AUTO_INCREMENT PRIMARY KEY , employee_id INT NOT NULL, leave_request_id INT NOT NULL, leave_date DATE NOT NULL, start_time time NOT NULL DEFAULT ’00:00:00′, end_time time NOT NULL DEFAULT ’00:00:00′ ); INSERT INTO `leaves` (`id`, `leave_request_id`, `leave_date`, `employee_id`, `start_time`, […]

Categories
Ask Health Mental Health

[ Mental Health ] Open Question : I feel disconnected?

Sometimes, especially when I m alone, I feel like everything s fake and dreamlike. Ive read that depressed people sometimes feel like this but i don t think I m depressed though, so…

Categories
Ask Psychology

[ Psychology ] Open Question : What is mindset of people who breaks appointment without notice?

i work in small healthcare clinic. when people make appointment and just doesn’t show up, it’s revenue loss and also it means other patient couldn’t have come since patient (who broke appointment) was taking that time slot. We call 1-2 days ahead to confirm. we understand things happens. But I’m not talking about people who […]

Categories
Chrome Development

Using Selenium, is there another, more reliable, way to use click command on an element in Headless Chrome?

After 2 days of struggling with an erratic click() command issue in Headless Chrome – in my case an Anchor (a) element with a href tag – and going through various threads advice about chromeOptions (–start-maximized, –window-size, etc…), and trying 12 different ways ( with sendKeys and Actions, and even submit() ) to work around […]

Categories
Development

Git: Enforce pull before merge

Sometimes, in my team, a developer will forget to pull from master before merging. We don’t really do code reviews at this point, which brings up my question: Is there a way to enforce that before merging Branch A into Branch B, Branch A has to contain the last commit of Branch B? EDITS I’m […]