2018-10-22         Zora

What's the correct way to store data in elasticsearch?

My example is like this:I want to store Alerts. For example I have Alert Type1, Alert Type2, etc..Each alert type can have different fields, for example:Alert Type1: { customer, incident_time, file.. }Alert Type2: { customer, incident_time, user.. }Option 1:Keep all the alerts under a single Index and each alert with a different typeOption 2:Keep an Index per alert which will keep each index smallWhat are the pros and cons of each approach?The searches I will do are mostly on the customer field and the incident_time fields, but also many queries will be done on a specific A...

 elasticsearch                     1 answers                     4 view
 2018-10-22         Zora

Dependently and Dynamically change Combo Box Value List in C# WinForm

In My C# WinForm, There are two comboboxes called cmbTransFirstHelper and cmbTransSecondHelper. Those comboboxes were populated from same table and same column in database. I used External DataLoad class for get data from database and those return DataTable type to the WinForm Class. There are two functions called loadFirstHelper and loadSecondHelper inside the winform's class to populate data to above comboboxes and those functions are calling when loading the form.Now I want this, When I select a value in cmbTransFirstHelper combobox, that value should be removed from the...

 c#                     1 answers                     44 view
 2018-10-22         Zora

Highlighted post in Django templates

I've created this model:class PostModel(models.Model): post_title = models.CharField(max_length=70) post_short_description = models.TextField(max_length=200) post_contents = models.TextField() post_publishing_date = models.DateTimeField(auto_now=False, auto_now_add=True) post_author = models.ForeignKey(AuthorModel, on_delete=models.CASCADE) post_keyconcept = models.ManyToManyField(KeyConceptModel) slug = models.SlugField(verbose_name="Slug", unique="True") post_highlighted = models.BooleanField(default=False) def __str__(self): return self....

 python                     2 answers                     100 view
 2018-10-22         Zora

Algorithm for finding the best route from single source to multiple destinations in a matrix

Problem statement:We have an m * n matrix. The starting point is the top left cell. We can only go down or right in the matrix. Destinations are randomly chosen in the matrix. Now we need to find the best routine with the following constraints:Each node on the route could only have one parent node but could have at most two child nodes.minimize duplication routes.For example, if we have destinations look like below:Instead of using the routine on the left-hand side, we should reduce it to the right-hand side one. prefer going right then down unless going down is shorter tha...

 algorithm                     3 answers                     43 view
 2018-10-22         Zora

How to get a string to relate to a specific value in an array in Python3

What I am trying to do is have a program that will take a word, and get the numeric values associated with each letter, so a is 1, b is 2 and so forth.What I have done so far is made an array for the alphabet and sliced the input word into strings of 1 letter each.alphabet = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']and thisword = input("""Give me a word""")let1 = word[1:1]let2 = word[2:2]let3 = word[3:3]let4 = word[4:4]let5 = word[5:5]let6 = word[6:6]let7 = word[7:7]let8 = word[8:8] ...

 arrays                     2 answers                     44 view
 2018-10-22         Zora

Weather Forecasting using neural network

I am trying to write a program for weather forecasting using Backpropagation. I have the data of different parameters like temperature, humidity, wind speed, sea level pressure etc. I have set 4 parameters (4 nodes) for input layer(temperature, humidity, wind speed, sea level pressure).Now I am confused about what will be the output/target. Monthly/seasonal division is necessary?And how can I normalize those 4 different parameters (between -1 to 1 )? You could treat this as a multi-class classification problem. Let us say you want to predict if the weather will be sunny...

 neural-network                     1 answers                     1 view
 2018-10-22         Zora

JPA datasorce ignores username in properties file

I have a test class which I use to check if the connection to the database is established. The credentials are saved in a properties file. When I run the tests in eclipse everything works fine. But when I run a maven build the tests fail because the username used to connect to the database is not the one I set in the properties file. It is the windows username. This is my code:Properties File:driverClassName=oracle.jdbc.driver.OracleDriveruser=database_dev1password=password_dev1url=jdbc:oracle:thin:@MyAwsomeDatabase:1521:DEV01Config Class:@Configuration@EnableTransactionMan...

 java                     1 answers                     9 view
 2018-10-22         Zora

Flutter | ExpansionTile property "children" throws a Bottom Overflowed issue on expanding

I am building a list of items fetched from Firestore wrapped in an ExpansionTile inside a ListView.builder(). The data is fetched properly. No issues there. I can see the list of those items.The problem is on Tile expansion I need to display some ListTile. But on expansion, it throws me a Bottom Overflowed by X pixels. To tackle this, I tried wrapping it in a ListView but it throws exception - Another exception was thrown: NoSuchMethodError: The method '<=' was called on null.No luck.I am coding something like this - import 'package:cloud_firestore/cloud_firestore.dart...

 listview                     2 answers                     43 view
 2018-10-22         Zora

Which tables/views contain the list of objects used by Service Broker?

I work with Service Broker. I need to know which Service Broker entities (message types, contracts, etc.) have been added to the database I am dealing with.The question refers to MS SQL Server 2005.Thank you! Nice article on the subject of service broker management views here...Troubleshooting Service Broker Problems [XXX]

 sql                     1 answers                     41 view
 2018-10-22         Zora

SQL filter query in dplyr database case sensitive

I want to filter a SQLite database in R looking for pattern in string. The problem is the LIKE sql query appear to be case insensitive.Below a reproducible example:library(DBI)library(dplyr)tb <- dplyr::tibble(a=c(rep("aMSq",3), rep("amsq",3), rep("AA",3)))mydb <- DBI::dbConnect(RSQLite::SQLite(), "")DBI::dbWriteTable(mydb, "tb", tb, overwrite=T)### Filtering the tabletb_sqlite <- tbl(mydb, "tb")tb_sqlite %>% filter( sql("a LIKE '%MS%'"))dbDisconnect(mydb)The output is case insensitive:# Source: lazy query [?? x 1]# Database: sqlite 3.22.0 [] a <chr...

 sql                     1 answers                     72 view
 2018-10-22         Zora

Order by birthday, disregarding year

How do you make a query where you ORDER BY birthday disregarding the year altogether. I need to eliminate/disregard the year and ORDER BY birthdate month and birthdate day from today's date in either ASC or DESC.The below won't work because the years of the birthdate come into play. The below example shows what happens when the year is regarded:John 01/02/1974Billy 11/15/2000Ally 06/25/2008SELECT * FROM users ORDER BY birthdateExpected results when ordering by birthday:John 01/02/1974Ally 06/25/2008Billy 11/15/2000 This will normalize all dates to the year 2000...

 sql                     4 answers                     2 view
 2018-10-22         Zora

Monkeyrunner on Ubuntu 16.04 to install android apk file

I have installed Android SDK on Ubuntu 16.04 which runs on Virtual Box on my laptop. I have a Samsung Galaxy Tab connected to the laptop. The device is accessible to the Virtual Machine. I try to install my android app (apk file)using monkeyrunner.The python script that I use is below# Imports the monkeyrunner modules used by this programfrom com.android.monkeyrunner import MonkeyRunner, MonkeyDevice# Connects to the current device, returning a MonkeyDevice objectdevice = MonkeyRunner.waitForConnection()# Installs the Android package. Notice that this method returns a boole...

 android                     1 answers                     13 view
 2018-10-22         Zora

Displaying a decimal value on a windows form

I need help with displaying a decimal value on a Windows Form.I have a class with a method to calculate an interest amount, listed below.public virtual decimal CalculateInterest(){ interest = (interestRate/100) * base.getBalance(); return interest;}In my main form, I am using this method when a button is clicked, listed below.private void btnCalcInt_Click(object sender, EventArgs e){ decimal endBalance; decimal intRate; decimal getIntGained; endBalance = Convert.ToDecimal(lblSaveEndingBalance.Text); intRate = Convert.ToDecimal(lblSaveIntRate.Text); Savings...

 c#                     3 answers                     95 view
 2018-10-22         Zora

Basic orchestration with Azure Service Bus?

I'd like to understand how much of the following scenario is supported by the Azure Service Bus:Worker server notifies an unknown number of webservers of an eventEach web server processes the message (processing takes sometime - 10-30 minutes)When every web server is done with processing of the first message, all of the web servers need to receive a new event. Basically I'm trying to synchronize a number of web roles after performing a long-running job on each web role.How much of this can I get "for free" from Azure service bus? Based on how i interpret your question, ...

 azure                     4 answers                     10 view
 2018-10-22         Zora

Dropdown not able to implement in React

import React, { Component } from "react";import { Route, BrowserRouter } from 'react-router-dom';import { NavLink } from 'react-router-dom';import axios from 'axios';import Home from "./Home";import Shop from "./Shop";import About from "./About";import Footer from "./components/Footer";import Banner from "./components/Banner";class Main extends Component { state = { topCategory: [] } componentDidMount() { axios.get('http://localhost:3030/topCategory') .then(res => { console.log(res.data.express.catalogGroupView); this.setState({ topCa...

 javascript                     2 answers                     102 view
 2018-10-22         Zora

Create (Cmake) C/C++ Library to Android without Android Studio

My goal is create a external library made in C/C++ which I can import in my Android Project.I know how to import, I know how to create a library from C/C++ inside the project using JNI, Cmake, etc. But this is not my goal.For this I'm using small steps, first with a simple library:gmath.c#include "gmath.h"#if defined(__GNUC__) && __GNUC__ >= 4#define GMATH_EXPORT __attribute__((visibility("default")))#elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)#define GMATH_EXPORT __attribute__((visibility("default")))#else#define GMATH_EXPORT#endifGMATH_EXPORT u...

 android                     1 answers                     60 view

Page 1 of 144  |  Show More Pages:  Top Prev Next Last