dataset

C# WPF Combobox select first item

女生的网名这么多〃 提交于 2019-12-22 01:33:35
问题 Goodday, I want my combobox to select the first item in it. I am using C# and WPF. I read the data from a DataSet. To fill the combobox: DataTable sitesTable = clGast.SelectAll().Tables[0]; cbGastid.ItemsSource = sitesTable.DefaultView; Combo box XAML code: <ComboBox Name="cbGastid" ItemsSource="{Binding}" DisplayMemberPath="Description" SelectedItem="{Binding Path=id}" IsSynchronizedWithCurrentItem="True" /> If I try: cbGastid.SelectedIndex = 0; It doesn't work. 回答1: Update your XAML with

Training dataset generator in OpenCV

瘦欲@ 提交于 2019-12-22 00:16:45
问题 I'm working on my bachaleor theses called "Traffic sign detection in image and video" and I'm using neural network called YOLO (You Only Look Once). I think its name is pretty self-explaining, but paper may be found here. This network is learning from not-cropped annotated images (Regular networks use to train on cropped images). To be able to learn this network, i need not-cropped annotated european traffic signs dataset. I wasn't able to find any, even not here, so i decided to generate my

Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints. error in VB.Net

杀马特。学长 韩版系。学妹 提交于 2019-12-21 20:43:50
问题 There were three similar questions in StackOverFlow but none gave an answer.. If have found why this error in occurring but don't know the fix. I am using Strongly Typed Dataset for my project which is created as a dll for DAL. I have added the Sql Server Table into this dataset using the designer and has created a DataAdapter It works fine when i insert using DataTableAdapter daLabTest.Insert(txtLabTestId.Text, cmbLabTestType.Text, cmbTestName.Text, txtLabFees.Text, dtpLabEffDate.Value) but

h5py: how to read selected rows of an hdf5 file?

纵饮孤独 提交于 2019-12-21 20:28:18
问题 Is it possible to read a given set of rows from an hdf5 file without loading the whole file? I have quite big hdf5 files with loads of datasets, here is an example of what I had in mind to reduce time and memory usage: #! /usr/bin/env python import numpy as np import h5py infile = 'field1.87.hdf5' f = h5py.File(infile,'r') group = f['Data'] mdisk = group['mdisk'].value val = 2.*pow(10.,10.) ind = np.where(mdisk>val)[0] m = group['mcold'][ind] print m ind doesn't give consecutive rows but

Compare two datasets in C#

隐身守侯 提交于 2019-12-21 17:51:16
问题 i have two datasets and i need to compare these two datasets such that if ID does not exist in one table then i need to write insert Query else update query. For Ex: Id in One dataset ID in second Dataset 1 1 2 2 3 4 I need to insert ID 3 to second dataset. Here is my code for your reference: if (ds.Tables[0].Rows.Count > 0 || clientDS.Tables[0].Rows.Count > 0) { for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { for (int j = 0; j < clientDS.Tables[0].Rows.Count; j++) { if (ds.Tables[0].Rows

Python - Pandas, Resample dataset to have balanced classes

扶醉桌前 提交于 2019-12-21 11:55:55
问题 With the following data frame, with only 2 possible lables: name f1 f2 label 0 A 8 9 1 1 A 5 3 1 2 B 8 9 0 3 C 9 2 0 4 C 8 1 0 5 C 9 1 0 6 D 2 1 0 7 D 9 7 0 8 D 3 1 0 9 E 5 1 1 10 E 3 6 1 11 E 7 1 1 I've written a code to group the data by the 'name' column and pivot the result into a numpy array, so each row is a collection of all the samples of a specific group, and the lables are another numpy array: Data: [[8 9] [5 3] [0 0]] # A lable = 1 [[8 9] [0 0] [0 0]] # B lable = 0 [[9 2] [8 1] [9

Getting started with Tensorflow - Split image into sub-images

一曲冷凌霜 提交于 2019-12-21 05:43:09
问题 This is my very first time using a Convolutional Neural Networks and Tensorflow. I am trying to implement a convolutional neural network that is able to extract vessels from Digital Retinal Images. I am working with the publicly available Drive database (images are in .tif format). Since my images are very large my idea is to split them into sub-images of size 28x28x1 (The "1" is the green channel, the only one I need). To create the training set I randomly crop a 28x28 batch iteratively from

Why does calling cache take a long time on a Spark Dataset?

纵然是瞬间 提交于 2019-12-21 04:39:25
问题 I'm loading large datasets and then caching them for reference throughout my code. The code looks something like this: val conversations = sqlContext.read .format("com.databricks.spark.redshift") .option("url", jdbcUrl) .option("tempdir", tempDir) .option("forward_spark_s3_credentials","true") .option("query", "SELECT * FROM my_table "+ "WHERE date <= '2017-06-03' "+ "AND date >= '2017-03-06' ") .load() .cache() If I leave off the cache, the code executes quickly because Datasets are

Dataset Designer Issue - Visual Studio 2008

佐手、 提交于 2019-12-21 04:10:15
问题 We're using a dataset to throw a small amount of data around amongst various nodes within our application. The dataset is in an assembly by itself as it is reference from many other components. The Visual Studio dataset tool has developed a strange habit of creating a new designer everytime a build is done. So, the project looks like this MyDataSet.xsd - MyDataSet.cs - MyDataset.designer.cs - .... Then a build is performed and the result is MyDataSet.xsd - MyDataSet.cs - MyDataset.designer.cs

.NET - How do I retrieve specific items out of a Dataset?

笑着哭i 提交于 2019-12-21 03:53:07
问题 I have the following code which connects to a database and stores the data into a dataset. What I need to do now is get a single value from the data set (well actually its two the first row column 4 and 5) OdbcConnection conn = new OdbcConnection(); conn.ConnectionString = ConfigurationManager.ConnectionStrings["ConnectionString2"].ConnectionString; DataSet ds = new DataSet(); OdbcDataAdapter da = new OdbcDataAdapter("SELECT * FROM MTD_FIGURE_VIEW1", conn); da.Fill(ds) So, I need to get two