wildcard

MySQL wildcard replace

匆匆过客 提交于 2019-12-11 02:29:14
问题 Hi i need help with a MySQL query. Is it possible to do some wildcard replace for a string like the example below? String:                         example.com/folderone /some/path/to/file.pdf String:                         example.com/foldertwo /some/path/to/file.pdf Replace: newsite.com /some/path/to/file.pdf newsite.com/some/path/to/file.pdf newsite.com/some/path/to/file.pdf To remove the folder and change the domain but keep the path. In this case each folder have a different name with a

Are we allowed to use wildcard during instantiation

China☆狼群 提交于 2019-12-11 02:25:37
问题 why are these declaration invalid in Java? List<Number> test = new ArrayList<? extends Number>(); List test = new ArrayList<? extends Number>(); are we not allowed to use wildcard during instantiation. and if the wildcards are only useful for passing them to methods? and List<Object> test = new ArrayList<Integer>(); is illegal because generics are not covariant correct? 回答1: The ? wildcard character means "unknown" not "any". It doesn't make any sense to instantiate a new container of unknown

List all Directories that do not contain a file with Wildcard Match

可紊 提交于 2019-12-11 02:24:17
问题 I need to be able to list all of the directories in a root folder that do not contain a file which contains the string merged . So for example, if I run the script from the directory C:\out , I will get a list of all the folders inside of C:\out which do not match the wildcard merged . Example: Tree: -c:\out --c:\out\test123 ---sample.meta ---sample_merged.meta --c:\out\test456 ---sample.meta ---sample_merged.meta --c:\out\test789 ---sample.meta --c:\out\test013 ---sample.meta Output: test789

How to fill List<? extends Shape> with derived Circle and Rectangle objects?

孤人 提交于 2019-12-10 23:55:29
问题 I have these simple classes: public abstract class Shape { public abstract void draw(Canvas c); } public class Circle extends Shape { private int x, y, radius; public void draw(Canvas c) { ... } } public class Rectangle extends Shape { private int x, y, width, height; public void draw(Canvas c) { ... } } These classes can be drawn on a canvas: public class Canvas { public void draw(Shape s) { s.draw(this); } } I would like to put all Circle and Rectangle objects in a single List and draw all

VBA Open file with wildcard knowing only extension

痞子三分冷 提交于 2019-12-10 23:15:46
问题 I am trying to get Excel to open any file in the a given folder (ThisWorkbook.Path\Peach\Apple) that has .xlsm extension (there is always only 1 file). Is it possible to open it with wildcard character? I do not know the name of the file, just the extension. If not, is there a way to do it? 回答1: Just ask the file system for the first matching file: Dim path As String: path = ThisWorkbook.path & "\Peach\Apple\" FindFirstFile = Dir$(path & "*.xlsm") If (FindFirstFile <> "") Then Workbooks.Open

Pandas rename columns with wildcard

半城伤御伤魂 提交于 2019-12-10 23:14:35
问题 My df looks like this: Datum Zeit Temperatur[°C] Luftdruck Windgeschwindigkeit[m/s] Windrichtung[Grad] Relative Luftfeuchtigkeit[%] Globalstrahlung[W/m²] Now i want to rename the columns like this:# wetterdaten.rename(columns={'Temperatur%': 'Temperatur', 'Luftdruck[hPa]': 'Luftdruck'}, inplace=True) Where % is a wildcard. But of course it will not work like this. The beginning of the column name is always the same in the log data, but the ending is temporally changing. 回答1: You can filter

Incompatible wildcard types that should be compatible [duplicate]

寵の児 提交于 2019-12-10 19:49:03
问题 This question already has an answer here : Bounded-wildcard related compiler error (1 answer) Closed 5 years ago . Following on from this question, which provides a solution but doesn't explain it (unfortunately, the links in the answers are now dead): Take the following method: void method(Map<?, ?> myMap) { Set<Map.Entry<?, ?>> set = myMap.entrySet(); ... } Simple, no? However, this fails to compile on jdk1.7.0_25: incompatible types required: java.util.Set<java.util.Map.Entry<?,?>> found:

Java language specification on wildcards

流过昼夜 提交于 2019-12-10 19:31:22
问题 I am going through this link (Chapter 4. Types, Values, and Variables) and did not understand below point: The relationship of wildcards to established type theory is an interesting one, which we briefly allude to here. Wildcards are a restricted form of existential types. Given a generic type declaration G<T extends B>, G<?> is roughly analogous to Some X <: B. G<X> . I appreciate if you provide good example to understand above point clearly. Thanks in advance. 回答1: The wording and

PHP mysql_real_escape_string() and % character

心不动则不痛 提交于 2019-12-10 17:48:39
问题 What does mysql_real_escape_string() do with the % (percent) character and how much of a security risk does it represent (and how to fix it)? 回答1: From the mysql_real_escape_string() documentation: Note: mysql_real_escape_string() does not escape % and _. These are wildcards in MySQL if combined with LIKE, GRANT, or REVOKE. As far as security, unless you are running a LIKE , GRANT , or REVOKE , it's a non-issue. LIKE is probably the only real concern. It's up to you how you would want to

Makefiles and wildcards

送分小仙女□ 提交于 2019-12-10 16:24:59
问题 Alright so this is my current setup for a makefile. There are files which are named public01.c , public02.c , etc. I'm trying to make object files for each of them using the public*.o label with a wildcard. public*.o: public*.c hashtable.h $(CC) $(CFLAGS) -c public*.c public*: public*.o $(CC) -o public* public*.o However, when I try and run the makefile, I get this: make: *** No rule to make target `public*.c', needed by `public*.o'. Stop. I guess it's treating public*.c as a label and not a