Posts

How to exclude Firebase Messaging from Unity iOS builds, but not Android builds

Image
Clash Royale CLAN TAG #URR8PPP How to exclude Firebase Messaging from Unity iOS builds, but not Android builds I have a Unity project that builds for both Android and iOS. I want to integrate Firebase on my Android builds, but not for my iOS builds. Is there a way to exclude Firebase Messaging from the iOS builds completely, but keep it in for Android? I don't see the options to do so in the Firebase settings panel. I tried to unselect the Editor/iOS parts of the unity package when installing it, but I still get linker errors (when building my iOS app in Xcode) that reference missing Firebase directories. Thanks in advance, - cg By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Unique_ptr: pointer being freed was not allocated when emplaced in list

Image
Clash Royale CLAN TAG #URR8PPP Unique_ptr: pointer being freed was not allocated when emplaced in list I have a simple C++ program like so: #include <iostream> #include <list> #include <memory> int main(void) { std::list<std::unique_ptr<int>> l; int x = 5; // throws runtime error: pointer being freed was not allocated l.emplace_back(&x); } When the program is run I obtain the following output: a.out(59842,0x7fffb13d1380) malloc: *** error for object 0x7ffee81489ac: pointer being freed was not allocated *** set a breakpoint in malloc_error_break to debug [1] 59842 abort ./a.out a.out(59842,0x7fffb13d1380) malloc: *** error for object 0x7ffee81489ac: pointer being freed was not allocated *** set a breakpoint in malloc_error_break to debug [1] 59842 abort ./a.out This tells me that during the destruction of the list the unique_ptr object that had been created is being destroyed, and during that destruction the pointer to x is bein...

Gradle sets incorrect (unexpected?) classpath on running task

Image
Clash Royale CLAN TAG #URR8PPP Gradle sets incorrect (unexpected?) classpath on running task I have my project structured in this way: projectRoot +-src +-main | +-java | | +-package/java files go here | +-resources | +-config | +-files go here +-test +-java | +-package/java files go here +-resources +-config | +-files go here +-features +-files go here When this project is built, it produces the following output structure: projectRoot +-out +-production | +-classes | | +-package/classes in here | +-resources | +-config | +-files in here +-test +-classes | +-package/classes in here +-resources +-config | +-files in here +-features +-files in here This is all...

Tick Checkbox IE Automation Excel VBA

Image
Clash Royale CLAN TAG #URR8PPP Tick Checkbox IE Automation Excel VBA I'm trying to export a file from website but for that i have to select the elements i want to export from a checkbox. The HTML code for the checkbox i want to tick is: <input id="MainReport_ctl04_ctl09_divDropDown_ctl00" type="checkbox" name="MainReport$ctl04$ctl09$divDropDown$ctl00" onclick="$get('MainReport_ctl04_ctl09').control.OnSelectAllClick(this);" class=""> I've tried: With IE.document.getElementsByName("MainReport$ctl04$ctl09$divDropDown$ctl00") .Item.Click end with And With IE.document.getElementsByName("MainReport$ctl04$ctl09$divDropDown$ctl00") .Item(0).Checked = True End With And Set obj = IE.document.getElementsByName("MainReport$ctl04$ctl09$divDropDown$ctl00") obj.FireEvent ("onclick") But nothing seems to work. Could someone help me please? Thank u in advanced! ...

Vaadin Grid wrap labels in componentColumns

Image
Clash Royale CLAN TAG #URR8PPP Vaadin Grid wrap labels in componentColumns I'm currently working on a webapp project in Vaadin 10 . On the main page there's an overview of your current chats. Each chat is displayed as a bubble looking like: Vaadin 10 It contains an image and a label. I placed the bubbles in a Grid to ensure fast loading and flexibility like this: `Grid<VisualGroup> cloudGrid = new Grid<VisualGroup>(); cloudGrid.setWidth("100%"); cloudGrid.setHeight("100%"); cloudGrid.getElement().getStyle().set("border","white"); cloudGrid.addComponentColumn(VisualGroupComponent::new); cloudGrid.setItems(groups);` My problem is that the label does not wrap when I put the components in the grid. If I create the component independently the text wraps correctly like: But if I use the grid like described above it looks: Does anyone know how to get text wrapping working in ComponentColumns in vaadin? EDIT: I finally got it working...

Can you generate sine wave data continuously from an Angular service and inject it into a component?

Image
Clash Royale CLAN TAG #URR8PPP Can you generate sine wave data continuously from an Angular service and inject it into a component? I have a component which has an injected service to retrieve static mock data. I would like to add the ability to generate data at a variable frequency and send the new (appended, time series) data to the component as it is generated. I can't for the life of me figure out how to accomplish this. All I know for sure is that the data object for the component must be immutable. plotter.component.ts: import { Component, OnInit } from '@angular/core'; import { MockDataService } from '../../services/mock-data/mock-data.service'; @Component({ selector: 'app-plotter', templateUrl: './plotter.component.html', styleUrls: ['./plotter.component.css'] }) export class PlotterComponent implements OnInit { single: any; multi: any; // rt needs to be an immutable object array // rt needs to be updated with data from ...

AngularJS compare two (scope) arrays and only POST the 'non-same' result (2018)

Image
Clash Royale CLAN TAG #URR8PPP AngularJS compare two (scope) arrays and only POST the 'non-same' result (2018) I have two arrays that i like to compare on the ID, if the ID from one array does not exist in the other i will add it with the Http Post. This is the build up: $scope.Games = [{id:1,Name:"BatMan"}, {id:2,Name:"SpiderMan"}, {id:2,Name:"Hulk"}]; $scope.NewGames = [{id:1,Name:"BatMan"}, {id:2,Name:"SpiderMan"}, {id:3,Name:"Hulk"}, {id:4,Name:"DeadPool"}, {id:5,Name:"IronMan"}, , {id:6,Name:"DrStrange"}]; so i load all the Games and NewGames with a GET in the two $scopes Now i would like to compare the two on the id_game, so i was thinking of something like this but can't get it to work, the http section works find however without the indexOf, it will add...

ITelemetryProcessor breaks dependency tracking

Image
Clash Royale CLAN TAG #URR8PPP ITelemetryProcessor breaks dependency tracking I have set up a custom ITelemetryProcessor for my .NET Core 2.1 Web API. I do not want HTTP status codes 400 or 401 to be displayed as error in Application Insights. The following class does this, but as soon as I use it SQL and HTTP client dependency tracking will no longer work: ApplicationInsights400IsOkProcessor public class ApplicationInsights400IsOkProcessor : ITelemetryProcessor { private ITelemetryProcessor Next { get; set; } /// <summary> /// Link processors to each other in a chain. /// </summary> /// <param name="next"></param> public ApplicationInsights400IsOkProcessor(ITelemetryProcessor next) { this.Next = next; } /// <summary> /// API Aufrufe mit Rückgabecode 400 und 401 sind keine Fehler /// </summary> /// <param name="item">Telemetry zum Verarbeiten</param> public void P...

Pandas how to calculate bygroup result based on the length of the each group and a count value of another column

Image
Clash Royale CLAN TAG #URR8PPP Pandas how to calculate bygroup result based on the length of the each group and a count value of another column I want to calculate the scoring rate of each zone by using bygroup in pandas, but not sure how to do it: Suppose the df has two columns as: Shot_type Shot_zone Goal Penalty_area Saved Penalty_area Goal Goal Box Saved Goal Box Here I want to groupy by Shot_zone, and calculate the scoring rate based on Shot_type's Goal counts / len() of each type Shot_zone. Here each Shot_zone has 1 goal and 1 saved, so the result should be like: Penalty_area 50% Goal Box 50% Is there any understandable approach to do so using Pandas? Thank you very much! 3 Answers 3 Using pd.crosstab(df.Shot_type,df.Shot_zone,normalize='index') Out[662]: Shot_zone GoalBox Penalty_area Shot_type Goal 0.5 ...

How to create if statement that is always checked in Python

Image
Clash Royale CLAN TAG #URR8PPP How to create if statement that is always checked in Python Can you create if statement that is always checked in python? Like: You can enter a command anytime during the execution of the code but you create if statement only once, not after each action. Can you show an example of what are you trying to achieve? Basically you should provide Minimal, Complete, and Verifiable example. – zipa 5 secs ago By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Read from YAML File

Image
Clash Royale CLAN TAG #URR8PPP Read from YAML File i have a yaml file to my chatbot i want read answer from yaml file exemple Person see hello Chatbot see Hello person how to do with code java to read answer from yaml file By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

How to count unique rows in Oracle

Image
Clash Royale CLAN TAG #URR8PPP How to count unique rows in Oracle I have an oracle database table with a lot of columns. I'd like to count the number of fully unique rows. The only thing I could find is: SELECT COUNT(DISTINCT col_name) FROM table; This however would require me listing all the columns and I haven't been able to come up with syntax that will do that for me. I'm guessing the reason for that is that this query would be very low performance? Is there a recommended way of doing this? Possible duplicate of SQL - how to count unique combination of columns – Organic Advocate Feb 15 at 22:40 5 Answers 5 How about SELECT COUNT(*) FROM (SELECT DISTINCT * FROM Table) Please format code to aid readability. This ...

Mapped color transformation on cors tainted image

Image
Clash Royale CLAN TAG #URR8PPP Mapped color transformation on cors tainted image I need to transform colors in an image obtained from an s3 server which disallows crossOrigin. This is the functionality I need: const img = new Image(); img.src = src; ctx.drawImage(img, 0, 0); const imageData = ctx.getImageData(0, 0, canvas.width, canvas.height); const colors = [25,50,100,255]; const data = imageData.data; for (let i = 0; i < data.length; i += 4) { if(data[i] == 1){data[i] = colors[1]} if(data[i] == 2){data[i] = colors[2]} if(data[i] == 3){data[i] = colors[3]} } but got tainted by crossOrigin error: I know I can not use getImageData in this case. I don't want to read the image data. getImageData But maybe complete my task through some other webGL / canvas operation? Rendering on a server or proxying is not possible. Possible duplicate of How to fix getImageData() error The canvas has been tainted by cross-origin data? ...

Checking if a String is contained in an Enum Set in O(1)

Image
Clash Royale CLAN TAG #URR8PPP Checking if a String is contained in an Enum Set in O(1) Let's say I have an enum like the following: public enum Utils { UTIL_1, UTIL_2, ... UTIL_n } Now, I have Set<Utils> myUtils , which contains a bunch of these enum entries. Some other module (on which I don't have any control) gives me one such util name (say " UTIL_i ") as a String. I need to check if it is contained in the set myUtils . Is there any way to perform this operation in O(1)? I understand, I could change the set to be a set of Strings, and then do a .contains() on that, but I want to keep it as a last resort. Set<Utils> myUtils UTIL_i myUtils Update : Following the suggestions in the answer, I tried a little experiment. I created a small code snippet to generate a java file which is an enum of a fixed size. I tried with size 1000, 2500, 5000. An enum of size 10000 showed me the error The code for the static initializer is exceeding the 65535 bytes lim...

How to return positive and negative numbers when reading a file

Image
Clash Royale CLAN TAG #URR8PPP How to return positive and negative numbers when reading a file I am writing a code that reads a file line by line and return only the following lines, as an example: int int0 = (-953); int int1 = (-411); int int2 = 5471; int int3 = 823; After that I would like to return only the numbers both positive and negative. To do that, I wrote the following: String str = line.replaceAll("\D+",""); System.out.println(str); The result of running this code is: 0953 1411 25471 3823 The output that I seek is: -953 -411 5471 823 How can I do that? does the number can be float ? – YCF_L 1 hour ago @Thomas Look at the variable naming 0, 1, 2, 3, then look at the start of each output number ;) – Glains ...

sending a keyword to bring the location

Image
Clash Royale CLAN TAG #URR8PPP sending a keyword to bring the location hello every one **i want to send a keyword in a message that bring me the location of the reciever when the message will send i don t know how to add this option in my code ** i have my own map that i created with fragment that gives you your position this is my main activity import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.util.Log; import android.view.View; import android.widget.EditText; import android.widget.TextView; public class Main3Activity extends AppCompatActivity { private static final String TAG = Main3Activity.class.getSimpleName(); @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main3); } /** * Uses an implicit intent to dial the phone with the Phone app. * Gets the phone number...