StackOverflow.com

VN:F [1.9.22_1171]
Rating: 9.3/10 (9 votes cast)

Random snippets of all sorts of code, mixed with a selection of help and advice.

How to copy template into slide from another PowerPoint?

28 July 2021 @ 3:07 am

I need to use a template that's used in a separate PowerPoint on a PowerPoint that's made using vba (I'll refer to the one vba makes as "this:). The way I was doing it was getting the custom layout from the slide master in the template PowerPoint and setting it equal to this PowerPoint custom layout. What was happening was that it looked like this PowerPoint was completely relying on the template in the template PowerPoint ( I guess it was a direct reference). When I closed that one it also closed this PowerPoint. How do I copy a template (custom layout) into another PowerPoint so it's not a direct reference and relying on template slide to constantly be open

Ignore input validation for hidden sections

28 July 2021 @ 3:07 am

So I have a big form with multiple sections wrapped inside divs and each section has some input fields in it. Not all the sections are visible and I'm using a toggle class c-hide to change the display property using jQuery (addClass and removeClass methods). Based on input value of certain radio buttons and dropdowns, the class label is applied or removed from respective sections. A sample section might look like: <div class="container reference-num-input c-hide"> <h3>RTI Reference Number (Online) <span class="c-mandatory">*</span></h3><br> <div class="form-floating col-6"> <input type="text" class="form-control" id="rti-reference" placeholder="x"> <label for="rti-reference">Reference ID</label> </div> <hr> </div> And here is the CS

How do I fetch table with attributes using BeautifulSoup?

28 July 2021 @ 3:06 am

how can I fetch table with other attributes using beautifulSoup? enter image description here

Image not draggable

28 July 2021 @ 3:06 am

I have the following code which works in the create function: invy1 = this.add.image(((window.innerWidth/2) - (20)), ((-29) + (window.innerHeight))).setScrollFactor(0).setDisplaySize(30, 30).setDepth(10).setInteractive(); this.input.setDraggable(invy1); this.input.on('drag', function (pointer, gameObject, dragX, dragY) { gameObject.x = dragX; gameObject.y = dragY; }); However, once I introduce the following switch in my update function, the image is no longer draggable and I have no idea why: switch(x[0]) { case "stone": invy1.setTexture('star').setDisplaySize(45, 45); break; case "wood": invy1.setTexture('wood').setDisplaySize(45, 45); break; case "bush": invy1.setTexture('bush').setDisplaySize(45, 45); break; default: invy1.setTexture('transparent'); break; }

Question regarding set size inside a map and vector iterator

28 July 2021 @ 3:06 am

class Solution { public: vector<vector<string>> suggestedProducts(vector<string>& products, string searchWord) { vector<vector<string>> res; map<string, set<string>> m; for (auto p : products) { for (int i = 1; i <= min(p.size(), searchWord.size()); ++i) { m[p.substr(0, i)].insert(p); } } for (int i = 1; i <= searchWord.size(); ++i) { string s = searchWord.substr(0, i); int sz = min(m[s].size(), 3); vector<string> in(m[s].begin(), m[s].begin() + sz); res.push_back(out); } return res; } }; With the code I had above, there are two questions I wanted to ask: For the int sz = min(m[s].size(), 3), I got "no matching function for call to 'min'". I'm assuming it's because that sz is not an integer? And how's that? Isn't sz

Druid Tuning Configuration

28 July 2021 @ 3:06 am

iam beginner using druid and kafka. I want to create interactive data realtime kafka-druid. I still confuse what tuning should i change of this configuration? enter image description here enter image description here Thank in advance

Is there any way to tell JUnit 5 test classes to use H2 Databases over MYSQL Databases?

28 July 2021 @ 3:06 am

In my spring boot application, I am using MYSQL Databases to store my data. But I want to do my test cases(JUNIT 5) using H2 Database. Is there any way to tell my test classes to use H2 Database over MYSQL? Note - I'm using multiple Databases in SQL. same as I need to use multiple Databases in H2 too.

Convert python float to C float (using struct)

28 July 2021 @ 3:06 am

I'm trying to save floating point number in a file with struct.pack. However, since Python float is really a C double, how can I save it as C float? If I use struct pack f, I'm getting precision errors. When I do it with struct.pack('d') then it works perfectly, but I would like to go with float since it saves space. Thanks

ArgumentError : Missing Keyword when Init a Class

28 July 2021 @ 3:05 am

I have a simple pattern result class to init on controller, everything works well on ruby 2.3.x <= 2.7.x, I try on ruby 3.0.1 with Rails 6.1.4. My project structure looks like : app/ ..controllers ....api ......v1 .........files_controllers.rb ..jobs ..mailers ..serializers ..services ....v1 ......list_result.rb ..value_objects A simple pattern result class I put on services directory module V1 class ListResult attr_reader :status, :status_message, :data, :meta SUCCESS = 1 def initialize(status_message:, data:, meta:) @status = SUCCESS @status_message = status_message @data = data @meta = meta end def success? @status == SUCCESS end end end And try to in on controller looks like : V1::ListResult.new(status_message: "&quo

Covert a VARCHAR2 to DATE

28 July 2021 @ 3:05 am

I need to convert VARCHAR2 in one column(DATEOLD) to DATE format in another column(DATENEW) in the same table. My VARCHAR2 is in the format YYYYMMDD Eg.20210728 UPDATE SUPPORT SET DATENEW = to_date(DATEOLD, 'MM/DD/YYYY') Doesn't seem to work?