天道酬勤,学无止境

问答

We are getting a permission denied error in IE8. facebook-graph-api

We are getting a permission denied error in IE8. It happens after the FB.init. We have tried the channelUrl fix. We have put the as the first tag after the body. We have tried the document.domain in both the script and in the channel.html. We have tried the FB.UIServer.setActiveNode workaround. It works fine in IE9, FF, Chrome and Safari. <div id="fb-root"></div> <script src="//connect.facebook.net/en_US/all.js"></script> <script type="text/javascript"> var myUserId; document.domain = 'XXXX.XXXX.com'; window.fbAsyncInit = function() { FB.init({ appId: 'XXXXXXXXX', status: true,`enter code here

2021-09-24 19:41:01   facebook   proxy   fbml

Force date as new line on reading non-delimited text file

I am trying to read in and work with a horribly formatted debug log. There are no consistent delimeters and it does not appear line breaks are encoded either. What I'd like to do is read in and parse the data to have a new line for each date (YYYY-MM-DD format). I am trying to work within the tidyverse but cannot seem to get something that will parse the file correctly. Is there a way to force lines to be delimited by a date pattern? None of these work: library(tidyverse) Log_File <- read.table("Example.txt", header = F, fill = T, skip = 1, allowEscapes = TRUE) Log_File <- read_delim("Example

2021-09-24 19:40:55   r   tidyverse   data-cleaning

How to use switchIfEmpty?

I need to fetch data from DB. If it's empty, get data from server and insert it into database. Here is my code, public Flowable<List<Data>> test() { return dataDao.allDatas() .switchIfEmpty(datas()) .doOnNext(datas -> userStoreDao.insert(datas)) ); } public Flowable<List<Data>> datas() { return Flowable.zip(userFavoriteDatas(), userOtherDatas(), (favoriteDatas, otherDatas) -> { favoriteDatas.addAll(otherDatas); return favoriteDatas; }); } public Flowable<List<Data>> userFavoriteDatas() { return userDatas() .map(UserDatas::favoriteDatas) .flatMapIterable(datas-> datas) .map(aLong -> new

2021-09-24 19:40:48   android   rx-java   rx-java2

Google Calendar API v3 : events from a particular week

I'm currently getting events from Google Calendar API v3 (using Javascript). I was stuck on getting access to the API : Google Calendar API V3 and Ajax : No 'Access-Control-Allow-Origin' header And now, I'm a bit confused: I'm trying to get event list from few days (2012-07-31 to 2012-08-04, GMT+1), so here's what I tried : gapi.client.load('calendar', 'v3').then(function(data) { var request = gapi.client.calendar.events.list({ 'calendarId': '[cal id]', "timeMin": "2012-07-31T00:00:00+01:00", "timeMax": "2012-08-05T00:00:00+01:00" }); request.execute(function(resp) { for (var i = 0; i < resp

2021-09-24 19:40:40   javascript   google-calendar-api

Matplotlib tkagg backend performance

I have a tkinter application that can plot a large number of data, where I have noticed poor pan and zoom performance when there is a large number of data on the canvas. Looking into the tkagg_backend (as suggested by this and several other questions), the function and documentation suggests that the canvas should only be redrawn once the user is idle. However, from current and previous experience the canvas has always been updating(redrawing) mid zoom/pan. Therefore, I was looking at the specific functions that are involved and have a question regarding that. The dynamic_update function: def

2021-09-24 19:40:32   python   performance   matplotlib   tkinter   tkinter-canvas

Two ViewHolders one Adapter

I have two fragments with different RecyclerViews, I made the both ViewHolders for the fragments: class RecyclerOneViewHolder(itemView: View): RecyclerView.ViewHolder(itemView) { val title = itemView.list_tv val image = itemView.list_img } class RecyclerTwoViewHolder(itemView: View): RecyclerView.ViewHolder(itemView) { val title = itemView.tv_card val image = itemView.iv_card val date = itemView.tv_card_date } And I have my adapter but for only the first ViewHolder. Can i share it for both ? How? class RecyclerAdapter(val movies: List<Movie>): RecyclerView.Adapter<RecyclerOneViewHolder>() {

2021-09-24 19:40:10   java   android   list   kotlin   adapter

Filter numpy array if elements in subarrays are repeated position-wise in the other subarrays

Unluckily it is terribly similar to: Filter a numpy array if any list within it contains at least one value of a previous row which is a question I asked some minutes ago. In this case I have a list b = np.array([[1,2], [1,8], [2,3], [4,2], [5,6], [7,8], [3,3], [10,1]]) What I want to do is slightly different now. I want to start at the beginning of the list and for each subarray. I want to check whether the element in position i (with respect to the subarray) is encountered in position i also in other subarrays. Hence, removing all such elements. For instance: Look at [1,2]: eliminate [1,8]

2021-09-24 19:39:32   python   arrays   numpy

How to introduce rounded cells with a background color?

I have seen how to set rounded borders for a table cell in this question How to create a rounded corner table using iText\iTextSharp? But is it possible to make cell that will have no borders, but colored and rounded background?

2021-09-24 19:39:27   c#   pdf   itextsharp

how to create setup for excel addin?

I have a created an excel addin application in vb.net using vs2010.The application is working fine while running from IDE. Now I want to create a setup for the application to install the same addin in other system. How can I do this? I created a setup project and added the dll of the addin and created setup file. When I installed it in other machine, installation was succesful. However I could not see the addin in excel when i opened it. Can someone help me on this?

2021-09-24 19:38:01   vb.net   excel   add-in   setup-project

Can I override a Map<Integer, Integer> with Map<String, Integer>?

I have the following class AccountWebappGridRow, which extends AccountGridRow: public class AccountWebappGridRow<Accounts> extends AccountGridRow implements java.io.Serializable { AccountGridRow contains has this field: private Map<Integer, Integer> balances; With public getters/setters: public Map<Integer, Integer> getBalances() { return balances; } public void setBalances(Map<Integer, Integer> balances) { this.balances = balances; } Is there a way that I can somehow override/replace the inherited private Map<Integer, Integer> balances; in my AccountWebappGridRow...with this instead: private

2021-09-24 19:37:29   java   dictionary   collections