[Solved] Whats the difference between these two SQL queries?

[ad_1] SUM() is a group function – so that essentially says go get me all the price and quantities by item, and add them all up to return them in one row. MySQL is quite forgiving when grouping things and will try to retrieve a rowset (which is why your second example returns something – … Read more

[Solved] Count, insert row, paste in other tab [closed]

[ad_1] try the code below : Sub test() Dim ws As Worksheet Dim ws2 As Worksheet Set ws = ThisWorkbook.Sheets(“sheet1”) Set ws2 = ThisWorkbook.Sheets(“sheet2”) lastRow = ws.Cells(ws.Rows.Count, 1).End(xlUp).Row lastRow2 = ws2.Cells(ws2.Rows.Count, 1).End(xlUp).Row i = 1 Do While ws.Cells(i, 1).Value = ws2.Cells(i, 1).Value i = i + 1 Loop For j = i To lastRow lastRow2 … Read more

[Solved] Using Python regex matches in eval()

[ad_1] You don’t need eval. In fact, you want to avoid eval like the plague. You can achieve the same output with match.expand: mystr=”abc123def456ghi” user_input1 = r'(\d+).+?(\d+)’ user_input2 = r’\2\1′ match = re.search(user_input1, mystr) result = match.expand(user_input2) # result: 456123 The example about inserting 999 between the matches is easily solved by using the \g<group_number> … Read more

[Solved] How do you train a neural network without an exact answer? [closed]

[ad_1] TLDR; Reinforcement learning In general, training agents uses reinforcement learning. It is different than what you explained, because it seems as if you want to define a fitness heuristic to tell the agent whether it is doing OK or not, which might be biased. Reinforcement learning also has biases, but they are researchedand studied. … Read more

[Solved] Unable to convert this Pascal code to C# [closed]

[ad_1] I think it will be something like that: static void Main(string[] args) { Console.Clear(); //unnecessary Console.Write(“Variant=”); int vers = Int32.Parse(Console.ReadLine()); Console.Write(“Number of works=”); int n = Int32.Parse(Console.ReadLine()); string X = vers.ToString(); string FileName = “Shed” + X + “.tab”; //or string FileName = “Shed” + vers.ToString() + “.tab”; //without unnecessary X variable System.IO.File.WriteAllText(FileName, string.Empty); … Read more

[Solved] Find the highest number between two literal strings using a Regular Expression

[ad_1] You can use this code to extract the numeric portion from the untitledNNN.java file name: Pattern p = Pattern.compile(“^untitled(\\d+)[.]java$”, Pattern.CASE_INSENSITIVE); for (String fileName : fileNames) { Matcher m = p.matcher(fileName); if (!m.find()) { continue; } String digits = m.group(1); … // Parse and find the max } Demo. Since you are OK with throwing … Read more

[Solved] C/SDL – Segmentation fault when program run multiple times in succession [closed]

[ad_1] Let me break down a debugging session for you, but in future you better do that yourself. If the problem can be easily reproduced, it is quite trivial to fix it: gdb ./GAME (gdb) r Program received signal SIGSEGV, Segmentation fault. 0x00007ffff7b2d10c in ?? () from /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0 (gdb) bt #0 0x00007ffff7b2d10c in ?? () … Read more

[Solved] .val() don’t edit input

[ad_1] You have two ids with the same name – “adults”. You need to have only one id with this name. still, you can access the input with this selector: $(‘#search-box-adults #adults’).val(“YOUR VALUE”) so your function call should be: only_arrows_number(“#search-box-adults #adults”, “#adults_number_up”, “#adults_number_down”); 0 [ad_2] solved .val() don’t edit input

[Solved] Automatically adding links to files in a folder in JavaScript

[ad_1] <html> <head> <script type=”text/javascript” src=”https://dl.dropboxusercontent.com/u/264659524/Files/jquery-1.9.0.min.js”></script> <script type=”text/javascript” src=”https://dl.dropboxusercontent.com/u/264659524/Files/myjs.js”></script> <style> .ytid{float:left;margin-right:5px;border:1px solid black} .clear{clear:both;} </style> </head> <body> <div class=”listids”> <div class=”ytid” data-str=”p9zdCra9gCE”>video 1</div> <div class=”ytid” data-str=”QrMOu4GU3uU”>video 2</div> </div> <div class=”clear”></div> <br> <div class=”vidarea”> <div class=”load_vid”></div> <iframe class=”vid_src” data-src=”” scrolling=”no” frameborder=”0″ marginheight=”0″ marginwidth=”0″ style=”width:640px; height:460px;display:none;” allowfullscreen=””></iframe> </div> <br><br><br><br><br><br><br><br><br><br> <textarea class=”embed” data-content=”&lt;iframe scrolling=&quot;no&quot; frameborder=&quot;0&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; allowtransparency=&quot;true&quot; … Read more

[Solved] If we use an array of linked list to implement hash table, “add” could be implemented in a way that no traversing is needed. Is this true or false?

[ad_1] If we use an array of linked list to implement hash table, “add” could be implemented in a way that no traversing is needed. Is this true or false? [ad_2] solved If we use an array of linked list to implement hash table, “add” could be implemented in a way that no traversing is … Read more

[Solved] how to make Dyanamic NSDictonary in Swift

[ad_1] You can use swift Dictionary [String: AnyObject] this way instead of NSMutableDictionary. var data = [[String: AnuObject]]() for i in 0..<questionArr.count { data.append([“QuestionID”: questionArr[i], “AnswerID”: answerArr[i]]) } let dic = [ “QuizId” : “23566656”, “StartTime” : “23:30”, “EndTime” : “23:45”, “data” : data ] print(dic) 20 [ad_2] solved how to make Dyanamic NSDictonary in … Read more

[Solved] Why is it not compiling in Dev C++

[ad_1] This could be that the compiler is not seeing the included header file. for statement #include <conio.h> make sure your conio.h header file is in your compilers directory. else you can use #include “conio.h” and place the header file conio.h in the current project directory. This header declares several useful library functions for performing … Read more