[Solved] Regex for these strings [closed]

You can use: [1-7]|9|8[abcd] Depending on whether you want the whole string to match, so that nothing else follows or precedes the match, you may need to add anchors: ^([1-7]|9|8[abcd])$ Or, alternatively, if you just want to match digits that are not followed by a letter (a, b, c, d) except when it is 8 … Read more

[Solved] How to merge two list of list in python

You may achieve this using itertool.chain() with list comprehension expression as: >>> a=[[1,2,3],[4,5,6]] >>> b=[[5,8,9],[2,7,10]] # v join the matched sub-lists # v v your condition >>> [i + list(chain(*[j[1:] for j in b if i[1]==j[0]])) for i in a] [[1, 2, 3, 7, 10], [4, 5, 6, 8, 9]] solved How to merge two … Read more

[Solved] Set alarm for selected data and time [closed]

@Override public void onTimeSet(TimePicker view, int hourOfDay, int minute) { Calendar calNow = Calendar.getInstance(); Calendar calSet = (Calendar) calNow.clone(); calSet.set(Calendar.HOUR_OF_DAY, hourOfDay); calSet.set(Calendar.MINUTE, minute); calSet.set(Calendar.SECOND, 0); calSet.set(Calendar.MILLISECOND, 0); if(calSet.compareTo(calNow) <= 0){ //Today Set time passed, count to tomorrow calSet.add(Calendar.DATE, 1); } setAlarm(calSet); }}; private void setAlarm(Calendar targetCal){ textAlarmPrompt.setText( “\n\n***\n” + “Alarm is set@ ” + targetCal.getTime() … Read more

[Solved] printing array in reverse order avoiding duplicates c++

You should initialize last, otherwise it will be filled with garbage and according to your logic, it will print last. int last = arr[lengthOfArray-1]; int count = 0; for(int i = lengthOfArray-1; i >=0; i–){ if(last == arr[i]){ ++count; } else{ cout << last << endl; count = 1; } last = arr[i]; } if … Read more

[Solved] Undo comboboxes – in groupbox

Problem solved. When combobox is databinded you have to clear databind, fill dataset again and repeat databind. This solved my problem, but It also all other databinded controls gets undo this way. solved Undo comboboxes – in groupbox

[Solved] Why my output isn’t correct?

I commented the changed portion and explained why. I didn’t change your code, so that you can understand easily. Try this : #include <stdio.h> #include <stdlib.h> #include <string.h> struct AdjListNode { char *dest; struct AdjListNode* next; }; struct AdjList { struct AdjListNode *head; // pointer to head node of list }; struct Graph { int … Read more

[Solved] Error while saving changes to custom config file [closed]

Requirements using System.Configuration; Read var appSettings = ConfigurationManager.AppSettings; string result = appSettings[key] ?? “Not Found”; Write var configFile = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); var settings = configFile.AppSettings.Settings; if (settings[key] == null) { settings.Add(key, value); } else { settings[key].Value = value; } configFile.Save(ConfigurationSaveMode.Modified); ConfigurationManager.RefreshSection(configFile.AppSettings.SectionInformation.Name); solved Error while saving changes to custom config file [closed]

[Solved] Django: how to get order_detail_data as per order_id

If you are using raw queries, then you just need to merge the data. Something like this should work, def merge_order_data_and_detail(orders, details): “””Group details by order_id and merge it in orders.””” # create dictionary key:order_id value:[order_detail_data] dic = {} for d in details: if d[‘order_id’] not in dic: dic[d[‘order_id’]] = [] dic[d[‘order_id’]].append(d) # iterate orders … Read more

[Solved] Dividing one column into two columns in SQL [duplicate]

try this: DECLARE @YourTable table (Column1 varchar(50)) INSERT @YourTable VALUES (‘Frodo Baggins’) INSERT @YourTable VALUES (‘Samwise Gamgee’) INSERT @YourTable VALUES (‘Peregrin Took’) INSERT @YourTable VALUES (‘Meriadoc Brandybuck’) INSERT @YourTable VALUES (‘aa’) INSERT @YourTable VALUES (‘aa bb cc’) SELECT LEFT(Column1,CHARINDEX(‘ ‘,Column1)) AS Names ,RIGHT(Column1,LEN(Column1)-CHARINDEX(‘ ‘,Column1)) AS Surnames FROM @YourTable –both queries produce same output SELECT SUBSTRING(Column1, … Read more

[Solved] Select multiple file to upload as populated in html table [closed]

This line throws an error var count = files.length; “Uncaught TypeError: Cannot read property ‘length’ of undefined” means that variable files is not defined anywhere. try to to define it, like this for example: var files = fileU[0].files; var count = files.length; console.log(count); 4 solved Select multiple file to upload as populated in html table … Read more