[Solved] How to convert the Varchar of sum to time using sql server 2008 [closed]

[ad_1] Try this: DECLARE @SUM VARCHAR(50)=’33.90′; SELECT CAST(CAST(LEFT(@SUM,CHARINDEX(‘.’,@SUM,0)-1) AS INT)+ CAST(SUBSTRING(@SUM,CHARINDEX(‘.’,@SUM,0)+1,LEN(@SUM)) AS INT)/60 AS VARCHAR(10))+’.’+ CAST(CAST(SUBSTRING(@SUM,CHARINDEX(‘.’,@SUM,0)+1,LEN(@SUM)) AS INT)%60 AS VARCHAR(10)) result: 34.30 1 [ad_2] solved How to convert the Varchar of sum to time using sql server 2008 [closed]

[Solved] how to write regex for this expression in java

[ad_1] The short answer: #a.+#((([A-Za-z]{3,9}:(?:\/\/)?)(?:[\-;:&=\+\$,\w]+@)?[A-Za-z0-9\.\-]+|(?:www\.|[\-;:&=\+\$,\w]+@)[A-Za-z0-9\.\-]+)((?:\/[\+~%\/\.\w\-_]*)?\??(?:[\-\+=&;%@\.\w_]*)#?(?:[\.\!\/\\\w]*))?) This will match any character except line breaks in the content section, and should match any url. NOTE: You will have to escape all backslashes in the given regex to represent it as a java String literal. Sources for the url regex: What is the best regular expression to check … Read more

[Solved] Swift 2 get the number of images in main bundle [closed]

[ad_1] Try this EDITED let myArray = NSMutableArray() var image:UIImage! var nimages = 0 for(;;nimages++){ let nameOfImg_ = entity.attribute let imageName = String(format: “name%@number%lu.jpg”, arguments: [nameOfImg_,(nimages + 1)]) if((NSBundle.mainBundle().pathForResource(imageName, ofType: nil)) != nil){ image = UIImage(contentsOfFile: NSBundle.mainBundle().pathForResource(imageName, ofType: nil)!) myArray.addObject(image!) }else{ break } } entity.attribute must be a String 12 [ad_2] solved Swift 2 get … Read more

[Solved] how to add search functionality in edittext in Android

[ad_1] Load all the contacts in array list or string array and then use AutoCompleteTextView for adding search functionallity Gett all contacts like this as expalined here public ArrayList<PhoneContactInfo> getAllPhoneContacts() { Log.d(“START”,”Getting all Contacts”); ArrayList<PhoneContactInfo> arrContacts = new ArrayList<PhoneContactInfo>(); PhoneContactInfo phoneContactInfo=null; Uri uri = ContactsContract.CommonDataKinds.Phone.CONTENT_URI; Cursor cursor = context.getContentResolver().query(uri, new String[] {ContactsContract.CommonDataKinds.Phone.NUMBER,ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME,ContactsContract.CommonDataKinds.Phone._ID}, null, null, ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME … Read more

[Solved] Why does this method cause infinite recursion? [closed]

[ad_1] func is always calling itself. There is no stopping condition. Each call creates a new stack frame, until the call stack is full and StackOverflowError is thrown. Recursive methods should always have a stopping condition. For example – n < 0 : public static int func(int n){ int result; if (n >= 0) result … Read more

[Solved] Filter list with complex expression

[ad_1] I believe this does what you want… arr = [[2,6,8],[1,4,7],[3,3,4],[2,4,9],[3,3,7]] foo = lambda arr, evenOdd, noDoubles: [ i for i in arr if not (evenOdd and (all(k % 2 == 1 for k in i) or all(k%2 == 0 for k in i))) and not (noDoubles and (len(i) != len(set(i))))] print(foo(arr, False, False)) print(foo(arr, … Read more