天道酬勤,学无止境

问答

Why does new Facebook Javascript SDK not violate the “same origin policy”?

The new Facebook Javascript SDK can let any website login as a Facebook user and fetch data of a user... So it will be, www.example.com including some Javascript from Facebook, but as I recall, that script is considered to be of the origin of www.example.com and cannot fetch data from facebook.com, because it is a violation of the "same origin policy". Isn't that correct? If so, how does the script fetch data?

2021-07-13 17:38:16   security   facebook-graph-api   same-origin-policy

Running Count within groups in a dataframe [duplicate]

This question already has answers here: Numbering rows within groups in a data frame (9 answers) Closed 5 years ago. I have an Orders database for an online shopping platform. The table I'm working with looks like this, where each line corresponds to one customer/item/date. OrderHistory <- data.frame(date=c("2015-02-01", "2015-03-01", "2015-04-01", "2015-03-01", "2015-04-01", "2015-05-01", "2015-05-01"), customer=c("A","A","A","B","B","B","B"), item=c("Candy", "Coffee", "Coffee", "Candy", "Candy", "Candy", "Coffee" )) What I would like to get is a running count of the number of times each

2021-07-13 17:38:09   r   dplyr

Storing Azure Vault Client ID and Client Secret

I am using .NET Core 2.0 and ASP.NET Core 2.0 for application development. The "test" application is a .NET Core Console application. The core code I am writing is a class library. Once proper testing. I choose to do this since I won't be putting this to use for awhile (it's replacing older ASPNET code). Anyway, since I have to work with a LOT of API keys for various services I decided to use Microsoft Azure Key Vault for storing the keys. I have this all setup and understand how this works. The test application uses a test Azure account so it's not critical. And since this is replacing legacy

2021-07-13 17:38:02   .net-core   asp.net-core-2.0   azure-keyvault   .net-core-2.0

Bulk IAP loading using Application Loader, price tiers

I get this: Row 1 has an unknown In-App purchase price tier: 2. How can this be an unknown price tier? I tried a few different ones like 3 and 4 but no go. Also, on a related issue, there seems to be no way of getting the current price tiers into the Application Loader (the drop down is very very empty), so I can't actually edit/set the price tier for an IAP even manually using the Application Loader interface. Is AL heavily bugged?

2021-07-13 17:37:36   in-app-purchase   app-store-connect

Troubleshoot Azure Inbound Security Rule Not Working

I created a new Windows Server 2012 R2 virtual machine in Microsoft Azure. Among other things installed on that virtual machine is a web site hosted in IIS, but I can't seem to get IIS on that server to respond externally. I am using the Resource Manager, so on my Public IP Address, I configured the DNS name (from Configuration), so the full DNS name is myapp.eastus2.cloudapp.azure.com where myapp is my actual app. Then, on my Network Security Group, I added an Inbound security rule with the following settings: Name: HTTP Priority: 1020 (there are no conflicting rules higher in priority)

2021-07-13 17:37:17   azure   dns

Getting Accurate Dimensions for a newly-created DOM object

I'm creating DOM elements dynamically (more specifically, using jQuery to create a DIV containing some text with css "width:auto", and using a "font-face" font, in the page OnLoad event) but find that the width of the div is not the expected size (specifically, the width is wrong) immediately after I create it and add it to the DOM tree. I need to know the width/height of the element because I will be doing some dynamic layout on it. As a workaround, I use the following code after creating the elements: SetTimeout(complete_layout,100) By delaying the completion of my layout with this extra

2021-07-13 17:37:10   javascript   jquery   dom   dynamic   dimensions

How to use flatMap in Android RxJava to make three web service call sequentially without using lambda function?

My API Client public class ApiClient { public static final String BASE_URL = "http://baseurl.com/wp-json/"; private static Retrofit retrofit = null; public static Retrofit getClient() { if (retrofit==null) { retrofit = new Retrofit.Builder() .baseUrl(BASE_URL) .addCallAdapterFactory(RxJava2CallAdapterFactory.create()) .addConverterFactory(GsonConverterFactory.create()) .build(); } return retrofit; } } My endpoint interface public interface ApiInterface { @GET("posts/category/politics/recent-stories/") Observable<ArrayList<ModelNewsPaged>> getPoliticsArrayListObservable(@Query("per_page") int

2021-07-13 17:36:58   android   retrofit2   rx-java2

java.io.IOException Not a data file after converting JSON to Avro with Avro Tools

I have a JSON file and an avro schema file, which correctly describes it's structure. I then convert the JSON file with the Avro tools into an avro file, without getting an error, like this: java -jar .\avro-tools-1.7.7.jar fromjson --schema-file .\data.avsc .\data.json > .\data.avro I then convert the generated Avro file back to JSON to verify that I got a valid Avro file like this: java -jar .\avro-tools-1.7.7.jar tojson .\data.avro > .\data.json This throws the error: Exception in thread "main" java.io.IOException: Not a data file. at org.apache.avro.file.DataFileStream.initialize

2021-07-13 17:36:45   java   json   avro   avro-tools

Why does the BackgroundWorker not call the RunWorkerCompleted on the right thread in this unit test?

The whole point of the backgroundWorker is to update the UI after a time-consuming task. The component works as advertised in my WPF app. However in my test, the callback is not invoked on the calling thread. [Test] public void TestCallbackIsInvokedOnClientThread() { var clientId = Thread.CurrentThread.ManagedThreadId; int callbackThreadId = -1; var manualEvent = new ManualResetEventSlim(false); var someUIControl = new TextBox(); var bw = new BackgroundWorker(); bw.DoWork += (s,e) => e.Result = 5 ; // worker thread bw.RunWorkerCompleted += (s, e) => { try { callbackThreadId = Thread

2021-07-13 17:36:32   c#   .net   multithreading

jQuery.clone() IE problem

I'm have some that uses jQuery.clone() to get the html of a page and then add it to a pre tag. It works correctly in Firefox and Chrome, but nothing happens in IE: <!DOCTYPE html> <html> <head> <script class="jsbin" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> <meta charset=utf-8 /> <title>JS Bin</title> <!--[if IE]> <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <script> $(function(){ $('button').click(function(){ var $clone = $('html').clone(); $('#output').text($clone.html()); }); }); </script> <style> article, aside

2021-07-13 17:36:16   javascript   jquery   internet-explorer   clone