Keyboard shortcut to find the currently selected text in Xcode 4

ughoavgfhw offered the correct answer (above). Use Cmd+E on the selected text to begin searching with that text. Then immediately type Cmd+Shift+F to search the whole project for all instances of the text hit enter. This is quite quick, consistent, and sensible. It’s not as immediate as Visual Studio’s single-stroke Find/Find-in-Files—Xcode requires two strokes rather … Read more

How to search in a List of Java object

You can give a try to Apache Commons Collections. There is a class CollectionUtils that allows you to select or filter items by custom Predicate. Your code would be like this: Predicate condition = new Predicate() { boolean evaluate(Object sample) { return ((Sample)sample).value3.equals(“three”); } }; List result = CollectionUtils.select( list, condition ); Update: In java8, … Read more

Searching for a string in a large text file – profiling various methods in python

Variant 1 is great if you need to launch many sequential searches. Since set is internally a hash table, it’s rather good at search. It takes time to build, though, and only works well if your data fit into RAM. Variant 3 is good for very big files, because you have plenty of address space … Read more

SQL search multiple values in same field

Yes, you can use SQL IN operator to search multiple absolute values: SELECT name FROM products WHERE name IN ( ‘Value1’, ‘Value2’, … ); If you want to use LIKE you will need to use OR instead: SELECT name FROM products WHERE name LIKE ‘%Value1’ OR name LIKE ‘%Value2’; Using AND (as you tried) requires … Read more

replace column values in one dataframe by values of another dataframe

If you set the index to the ‘Group’ column on the other df then you can replace using map on your original df ‘Group’ column: In [36]: df[‘Group’] = df[‘Group’].map(df1.set_index(‘Group’)[‘Hotel’]) df Out[36]: Date Group Family Bonus 0 2011-06-09 Jamel Laavin 456 1 2011-07-09 Frank Grendy 679 2 2011-09-10 Luxy Fantol 431 3 2011-11-02 Frank Gondow … Read more

Search a list of dictionaries in Python

You can use a generator expression: >>> dicts = [ … { “name”: “Tom”, “age”: 10 }, … { “name”: “Mark”, “age”: 5 }, … { “name”: “Pam”, “age”: 7 }, … { “name”: “Dick”, “age”: 12 } … ] >>> next(item for item in dicts if item[“name”] == “Pam”) {‘age’: 7, ‘name’: ‘Pam’} If … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)