lundi 13 février 2017

cfgmgr32.h in Universal Windows

Vote count: 0

I need to use SetupDiGetClassDevs function to communicate with HID device. But it's not possible in Universal Windows platform as SetupAPI.h is not supported.

So I found in MSDN about Porting code from SetupApi to CfgMgr32 which basically using CM_Get_Device_xx functions in CfgMgr32.h

However, in CfgMgr32.h, it defines #if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM), and Universal Windows app is WINAPI_PARTITION_APP. So all the functions are inaccessible.

All the CM_Get_Device_xx functions' target platform is Universal though, according to MSDN

Does anyone have try out this in Universal Windows platform? Probably there is some pre-configuration in Project properties? Appreciate the help, thank you.

asked 1 min ago

Let's block ads! (Why?)



cfgmgr32.h in Universal Windows

OneNote page exist but resource link from OneNote API is expired

Vote count: 0

I'm build OneNote add-in and I need some export feature.

From my search, I found only I could use is OneNote API with preAuthenticate param.

It gave me html content and I confirmed it rendered properly with images within in browser yesterday. But today, image links giving below error. And calling above OneNote API gives same. I can't find any way to get renewed one.

{
   @api.url: "http://ift.tt/2l9Migs",
   code: "20130",
   message: "No HTTP resource was found that matches the request URI Resource not found, perhaps the public link has expired. Try a new public page content call.."
}

So, my question is

  1. Is there any way to get html content of OneNote page without expiration?
  2. How to get html content with renewed?
  3. Is there any add-in or OneNote API to export OneNote page as pdf file?

Thanks in advance!

asked 1 min ago

Let's block ads! (Why?)



OneNote page exist but resource link from OneNote API is expired

helpicon functionality on form element using Jquery

Vote count: 0

I am having below form with helpIcon for every form element with description. How we can show help when we are hover on help icon and mouseout using jquery? I am quit new for jquery. so please can someone give simple implementation?

Can anybody help with this issue? Thanks in advance.

asked 21 secs ago

Let's block ads! (Why?)



helpicon functionality on form element using Jquery

specific successRedirect in passport.js with local strategy

Vote count: 0

I have a question about successRedirecting in passport.authenticate. I'm using passport.js and local strategy in nodejs and express for user login and trying to make specific successRedirect route.

For example, if I log in with user id: gpaul(pretended to be successed logging in), then successRedirect route is wanted to be '?channel=gpaul'.

I made the code like below

var data_1 = {email:''};
app.post('/login',
  function (req,res,next){
    req.flash("email");
    data_1.email = req.body.email;
    console.log(data_1.email);
    next();
  }, passport.authenticate('local-login', {
    successRedirect : ('/status.html?channel='+ data_1.email),
    failureRedirect : '/login',
    failureFlash : true
  })
);

After implementing above code, the address comes out with blank , localhost:4000/?channel= from the console log it comes out correctly, but in successRedirect, it doesn't work at all..

Does anybody have any ideas for specific successRedirecting? Please help me out here..

Thanks.

asked 37 secs ago

Let's block ads! (Why?)



specific successRedirect in passport.js with local strategy

Natively implement $ in javascript

Vote count: 0

I was asked a question to implement the following in Javascript

$(div).css('color','red');

I've implemented the following, but I still need pointers.

var $ = new function(selector){

var css = function(){

  document.classList.add('color:red');

};

};

$.prototype.prop = function(){ //for $(div).prop('style', 'color:red');
// need to write code for prop
}

How can I implement in this case?

$(div).prop('style', 'color:red');

How can i natively implement this in javascript?

asked 45 secs ago

Let's block ads! (Why?)



Natively implement $ in javascript

Surefire is triggering jacoco, and that want a minimum coverage. I need to disable that for now

Vote count: 0

I need to disable jacoco for checking for a minimum code coverage amount. Simple reason is that we are just beginning to write unit tests now, retroactively. We can't just not ship because a product which currently works, can't pass some tests. We need to add these tests over time, or severely reduce the minimum.

How do I either disable jacoco, or lower the minimum to 0?

asked 1 min ago

Let's block ads! (Why?)



Surefire is triggering jacoco, and that want a minimum coverage. I need to disable that for now

pandas GroupBy aggregate only one column

Vote count: 0

I have a DataFrame of the following form:

>>> sales = pd.DataFrame({'seller_id':list('AAAABBBB'),'buyer_id':list('CCDECDEF'),\
                          'amount':np.random.randint(10,20,size=(8,))})
>>> sales = sales[['seller_id','buyer_id','amount']]
>>> sales
  seller_id buyer_id  amount
0         A        C      18
1         A        C      15
2         A        D      11
3         A        E      12
4         B        C      16
5         B        D      18
6         B        E      16
7         B        F      19

Now what I would like to do is for each seller calculate the share of total sale amount taken up by its largest buyer. I have code that does this, but I have to keep resetting the index and grouping again, which is wasteful. There has to be a better way. I would like a solution where I can aggregate one column at a time and keep the others grouped. Here's my current code:

>>> gr2 = sales.groupby(['buyer_id','seller_id'])
>>> seller_buyer_level = gr2['amount'].sum() # sum over different purchases
>>> seller_buyer_level_reset = seller_buyer_level.reset_index('buyer_id')
>>> gr3 = seller_buyer_level_reset.groupby(seller_buyer_level_reset.index)
>>> result = gr3['amount'].max() / gr3['amount'].sum()

>>> result
seller_id
A    0.589286
B    0.275362

I simplified a bit. In reality I also have a time period column, and so I want to do this at the seller and time period level, that's why in gr3 I'm grouping by the multi-index (in this example, it appears as a single index). I thought there would be a solution where instead of reducing and regrouping I would be able to aggregate only one index out of the group, leaving the others grouped, but couldn't find it in the documentation or online. Any ideas?

asked 2 mins ago

Let's block ads! (Why?)



pandas GroupBy aggregate only one column