Posts

winscard - Getting the "name" of the smartcard for SCardGetCardTypeProviderName() -

in order crypto context cryptacquirecontext() , need know provider name smartcard in slot. according documentation, scardgetcardtypeprovidername() this, param 2 card name, , can't see how determine non-interactively. documentation/examples i've seen either harcode name or rely on scarduidlgselectcard() , displays ui. similarly reading around scardlocatecards() , although takes list of smartcard names (for i'm populating scardlistcards() , doesn't seem pass identifies name of smartcard inserted. i suspect i'm missing obvious, can't see what. i missing something. scardlocatecards returns part of strucutre atr of smartcard, can used in scardlistcards : scard_readerstate smartcardstate[maximum_smartcard_readers]; result = scardlocatecards (context, cardslist, smartcardstate, readercount); if (result == scard_s_success) { int i; (i = 0; < readercount; i++) { if (scard_state_atrmatch & smartcardstate[i].dweventstate) ...

c# - Mixing two linq statement into one? -

i have 2 linq statements, both of them working. wondering if possible mix them 1 , proper list after 1 linq. var result = list3.where(srodek => list4.any(x => x == srodek.srodek.category1) && (srodek.srodek.source.device == _text || srodek.srodek.id.device == _text)) .tolist(); var list666 = list3.select(obj => new { obj, dt = datetime.parseexact(obj.leftcolumn, dateformat, cultureinfo.invariantculture) }) .where(x => x.dt >= czas11 && x.dt <= czas22) .select(x => x.obj).tolist(); one list: var result = list3.where(obj => { var dt = datetime.parseexact(obj.leftcolumn, dateformat, cultureinfo.invariantculture); return (list4.any(x => x == obj.srodek.category1) && (obj.srodek.source.device == _text || obj.srodek.id.device == _text)) || ...

android - Addview does not working -

i have code: linearlayout linear = (linearlayout) findviewbyid(r.id.parameterslayout); layoutparams b = new layoutparams( layoutparams.wrap_content, layoutparams.wrap_content); textview view = new textview(this); view.setlayoutparams(b); view.settextcolor(color.black); view.settext("test"); linear.addview(view); when use code dont see textview . the linearlayout xml code: <linearlayout android:id="@+id/parameterslayout" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="@+id/parameterschoose" android:orientation="vertical" > </linearlayout> but if run code again can see new textview added , previous textview aswell. so previous textview becomes visible. i use logs: log.i("c...

python - numpy on cluster via ssh -

for studies have use cluster logged on via ssh. want use python script using numpy modules. unfortunately numpy version seems to old , doesn't include needed modules. how can access newer numpy without sudo rights? if pip installed on cluster, install numpy under home directory on cluster: pip install --user numpy

image - Lync 2013 Profile picture extension -

our company switched lync 2013 , noticed under "settings/my profile picture" there no longer option specify profile image. in lync 2013 @ least set picture less 30kb hosted on webserver. funny thing can use lync 2013 server account old lync 2010 client , i'm still able set profile picture (tested & woks). seems microsoft killed feature in client not on server (lol!?!?). i write tool able set picture without having install old lync 2010 client. hints, solutions or read? update of 12/11/2013 the latest lync update ( lync client cu3 (november update) ) has option set photo added gui. link kb article link download article explanations , screenshots can found here: lync client cu3 (november update) – show picture website! . original answer this question comes more often. it's indeed user interface change between lync 2010 , 2013 clients, option set image url has been removed. underwater option still available though, , can publish photo ur...

Windows Forms Application C# Style -

Image
i developing windows form application in visual studio 2008 (c#) , want add style items. i have been investigating few ideas have not found example how it. possible? my app looks like: but want add more style in buttons, textboxs , other items have: my boss insists on using visual studio 2008. to without purchasing else, create own custom button , text box controls, either scratch or controls derived existing windows forms controls , overriding onpaint etc. take @ what's been done here: http://dotnetrix.co.uk/button.htm you investigate third party options. or, use wpf if that's possibility others have said. i'd push wpf! if there's existing winforms code base can host wpf elements in winforms. see: walkthrough: hosting windows presentation foundation control in windows forms

Relating two models through associated foreign keys with ruby on rails -

i'm having trouble setting relationships , queries. here simple explaination of want accomplish. have 3 models: drawings, changes, , revisions. a drawing has many revisions a change has many revisions a change has many drawings through revisions the drawings have fields primary key string: drawing_number unique each drawing. when create new change , have nested form creates new revisions within change. have 1 of fields in new revision drawing_number though foreign key drawing_id . there way set enter drawing_number in form, finds drawing_id matches drawing_number , , adds drawing_id drawing_id column in revisions table. in other words, want relate revisions drawings using associated field not foreign key. for example: have drawing_id = 7 , drawing_number = a7114b1 i create new change has revision form nested in it. enter drawing_number a7114b1 form, revision model has drawing_id column, not drawing_number column. logic find drawing_id matches drawin...