wildcard

Entity Framework: combining exact and wildcard searching conditional on search term

删除回忆录丶 提交于 2019-12-12 21:19:50
问题 I'm creating a query to search the db using EF. TdsDb being the EF context. string searchValue = "Widget"; TdsDb tdsDb = new TdsDb(); IQueryable<Counterparty> counterparties; I can do exact match: counterparties = tdsDb.Counterparties.Where(x => x.CounterpartyName == searchValue); or wildcard match: counterparties = tdsDb.Counterparties.Where(x => x.CounterpartyName.Contains(searchValue)); But I want to be able to do both i.e. (psudo code) counterparties = tdsDb.Counterparties.Where(x => if

WildCard for Object<String> in Java6

时光总嘲笑我的痴心妄想 提交于 2019-12-12 18:25:27
问题 Please how to correct casting and remove warning [unchecked] unchecked cast required: T found: java.lang.Object from SSCCE import java.awt.*; import javax.swing.*; public class JComboBoxWithWildCard { private JDialog dlg = new JDialog(); private final Icon errorIcon = UIManager.getIcon("OptionPane.errorIcon"); public JComboBoxWithWildCard() { JComboBox comboWithCustomRenderer = new FlexiComboBox<String>( "1 one", "2 two", "3 three", "4 four", "5 five", "6 six", "7 seven", "8 eight", "9 nine",

Searching files in NTFS

為{幸葍}努か 提交于 2019-12-12 16:25:11
问题 We have a fairly large disk array with roughly 2-3 million XML files on it. The disk is formatted with NTFS and we would like to search the filesystem using wildcards. So something like * SomePartOfTheFilename * would be a typical search query. We are using .Net and are finding that using DirectoryInfo appears to be slow. DirectoryInfo directoryInfo = new DirectoryInfo(directory); List<FileInfo> fileInfos = directoryInfo.GetFiles(searchString, SearchOption.AllDirectories).ToList(); Using

Find and Replace RegEx question

穿精又带淫゛_ 提交于 2019-12-12 16:23:54
问题 I am starting to get a grip on RegEx thanks to all the great help here on SO with my other questions. But I am still suck on this one: My code is: StreamReader reader = new StreamReader(fDialog.FileName.ToString()); string content = reader.ReadToEnd(); reader.Close(); I am reading in a text file and I want to search for this text and change it (the X and Y value always follow each other in my text file): X17.8Y-1. But this text can also be X16.1Y2.3 (the values will always be different after

SSIS Excel Import - Worksheet variable OR wildcard?

ⅰ亾dé卋堺 提交于 2019-12-12 14:43:13
问题 I have a SSIS data import package that uses a source Excel spreadsheet and then imports data into a SQL Server database table. I have been unsuccessful in automating this process because the Excel file's worksheet name is changed every day. So, I have had to manually change the worksheet name before running the import each day. As a caveat, there will never be any other worksheets. Can I make a variable for the worksheet name? Can I use a wildcard character rather than the worksheet name?

How to instantiate generics using wild card?

孤街浪徒 提交于 2019-12-12 14:36:36
问题 Lets research some generic instantion situation using wild card: 1 This code List<?> list = new ArrayList<?>(); generates following error: required: class or interface without bounds found: ? 2 But this List<?> list = new ArrayList< Set<?> >(); compiles succesfully. 3 and this: List<Set<?>> list = new ArrayList< Set<?> >(); compiles succesfully too. 4 but this: List<Set<Map<?,?>>> list = new ArrayList< Set<Map<String,String>> >(); generates required: List<Set<Map<?,?>>> found: ArrayList<Set

If current page URL equals X OR X?

柔情痞子 提交于 2019-12-12 13:07:10
问题 I found this code on the internetz, it checks the current page url; function curPageURL() { $pageURL = 'http'; if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";} $pageURL .= "://"; if ($_SERVER["SERVER_PORT"] != "80") { $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"]; } else { $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"]; } return $pageURL; } So now I can do something like this; elseif (curPageURL() == "http://www.example.com/pageexample")

Reading multiple csv files at different folder depths

自作多情 提交于 2019-12-12 12:57:50
问题 I want to recursively read all csv files in a given folder into a Spark SQL DataFrame using a single path, if possible. My folder structure looks something like this and I want to include all of the files with one path: resources/first.csv resources/subfolder/second.csv resources/subfolder/third.csv This is my code: def read: DataFrame = sparkSession .read .option("header", "true") .option("inferSchema", "true") .option("charset", "UTF-8") .csv(path) Setting path to .../resource/*/*.csv omits

GNU make wildcard alternative?

北战南征 提交于 2019-12-12 10:46:30
问题 I would like to select all files in directory but using FreeBSD's make. In GNU make this approach works: FILES=$(wildcard *.c) I am using FreeBSD's make, not GNU make so I am looking for command that will work in FreeBSD's make. As it s stated in bottom link, FreeBSD has it's own functions but I cannot find them. Generic Makefile not working on FreeBSD 回答1: You can use != to execute a command in FreeBSD's make . E.g: FILES!= ls *.c or if you want to find files in subdirectories as well; FILES

ssl wildcard sub domain www.sub.domain.com

牧云@^-^@ 提交于 2019-12-12 09:58:50
问题 I've purshase a wildcard ssl certificat for *.domain.com. I use: startssl provider for ssl certificat Apache VirtualHost I want every request to be redirected to HTTPS NO-WWW I managed to do this: http ://sub.domain.com => https ://domain.com is ok http :// www .sub.domain.com => https ://sub.domain.com is ok BUT https ://www.sub.domain.com => https ://domain.com is NOT OK (NET::ERR_CERT_COMMON_NAME_INVALID) Can you help me ? <VirtualHost *:80> ServerName sub.domain.com Redirect permanent /