Posts

c# - How to get the clicked LinkButton text in GridView to a label in Popup Panel -

c# - How to get the clicked LinkButton text in GridView to a label in Popup Panel - i using modal popup within gridview linkbutton. what need utilize value of clicked linkbutton appear on label on popup panel <asp:gridview id="gridview1" runat="server"> <columns><asp:templatefield> <itemtemplate> <asp:linkbutton id="linkbutton1" runat="server" onclick="linkbutton1_click" text='<%#eval("empname") %>'></asp:linkbutton> </itemtemplate> </asp:templatefield></columns> </asp:gridview> <asp:linkbutton id="lnkdummy" runat="server"></asp:linkbutton> <asp:modalpopupextender id="linkbutton1_modalpopupextender" runat="server" dynamicservicepath="" enabled="true" targetcontrolid="lnkdummy" popupcontrolid="panel1"> <...

objective c - Most efficient way to have a live countdown -

objective c - Most efficient way to have a live countdown - i writing app includes countdown. countdown displayed on label, not sure if updating label efficiently. using timer interval of 1 second. there way consume less resources? also, crash on older devices? - (void)viewdidload { [super viewdidload]; //create calendar nsdates gregorian = [[nscalendar alloc]initwithcalendaridentifier:nsgregoriancalendar]; [gregorian settimezone:[nstimezone timezonewithname:@"est"]]; //create nsdate lunchtime based on = [nsdate date]; nsdatecomponents *compsofnow = [gregorian components:(nsweekdaycalendarunit |nsdaycalendarunit | nshourcalendarunit | nsminutecalendarunit |nsyearcalendarunit|nsmonthcalendarunit|nseracalendarunit)fromdate:now]; [compsofnow sethour:12]; [compsofnow setminute:50]; lunchtime = [gregorian datefromcomponents:compsofnow]; //create timer , set text nstimer *timer = [nstimer scheduledtimerwithtimeinterval:1 target:self selector:@selector(timerticked:) us...

sorting - I want to sort array of arrays in Perl, but the result is not sorted -

sorting - I want to sort array of arrays in Perl, but the result is not sorted - i have array of arrays want sort. each element of array array 3 elements. array looks like: my @a = ([2,3,1], [1,2,3], [1,0,2], [3,1,2], [2,2,4]); i want sort in ascending order. when comparing 2 elements, first number used. if there tie, sec number used, , 3rd number. here code. utilize function 'cmpfunc' compare 2 elements. sub cmpfunc { homecoming ($a->[0] <=> $b->[0]) or ($a->[1] <=> $b->[1]) or ($a->[2] <=> $b->[2]); } @b = sort cmpfunc @a; print "result:\n"; $element (@b) { print join(",", @{$element}) . "\n"; } result: 1,2,3 1,0,2 2,3,1 2,2,4 3,1,2 the result sorted, not correct. expect is: 1,0,2 1,2,3 2,2,4 2,3,1 3,1,2 is there error in comparing function? unusual thing is, when set comparing code in block, result correctly sorted. my @c = sort { ($a-...

salesforce - Apex Test Class - How to set a rollup count field in a test class -

salesforce - Apex Test Class - How to set a rollup count field in a test class - trying set value roll summary field in test class improve code coverage. how do it? public class clspreferrediasetext { list<preferredia__c> preferredias; public static preferredia__c[] tobeclosed = new preferredia__c[0]; public static preferredia__c[] newpreias = new preferredia__c[0]; public static preferredia__c loopadd; public static preferredcontact__c[] contactlists = new preferredcontact__c[0]; public static account[] invoicedaccounts = new account[0]; public static preferredia__c[] monkey; public clspreferrediasetext(apexpages.standardsetcontroller controller) { preferredias = (list<preferredia__c>) controller.getselected(); } public void getinitcloseinv() { tobeclosed = [select id, account__c, account__r.id, account__r.name, account__r.accountnumber, specialist__c, ...

asp.net mvc 3 - How do I get the full name of a user in .net MVC 3 intranet app? -

asp.net mvc 3 - How do I get the full name of a user in .net MVC 3 intranet app? - i have mvc 3 intranet application performs windows authentication against particular domain. render current user's name. in view, @user.identity.name is set domain\username , want total firstname lastname you can this: class="lang-cs prettyprint-override"> using (var context = new principalcontext(contexttype.domain)) { var principal = userprincipal.findbyidentity(context, user.identity.name); var firstname = principal.givenname; var lastname = principal.surname; } you'll need add together reference system.directoryservices.accountmanagement assembly. you can add together razor helper so: class="lang-cs prettyprint-override"> @helper accountname() { using (var context = new principalcontext(contexttype.domain)) { var principal = userprincipal.findbyidentity(context, user.identity.name); @pr...

redirect - Facebook page app -

redirect - Facebook page app - i`m admin on facebook fan page. problem when seek create app facebook fan page, facebook redirects me profile, , creating app myself , not facebook fan page. is there way this? i need app id , app secret facebook fan page. kalvin klien, please don't fall on getting out of bed, need utilize user profile create apps, not page profile. documented here: create new app business account create facebook app goes in circles page can company page accounts create apps? if want facebook tell you, please 1) log facebook account 2) switch using facebook page (aka business page) 3) go to: https://developers.facebook.com/apps 4) read error message says: to access page, you'll need switch using facebook page using facebook yourself. facebook redirect facebook-page

sql server 2008 - Determining the most effective and safest table locks during bulk data copy -

sql server 2008 - Determining the most effective and safest table locks during bulk data copy - this going 1 of worst-of-the-worst situations you're going want suggest exclusively different. don't worry, know, , unfortunately there's nil can it, please seek limit answers ones explain smallest alter possible create biggest impact. with said, here's situation: there process replicates info sybase server (15.5) sql server (2008 r2) every 30 minutes during business hours. on sql server, there linked server sybase database copying tables. here's scary part: copying done deleting of existing rows , inserting new ones sybase, in fashion (within stored procedure on sql server, triggered enterprise scheduling software): -- table 1 delete abc1; insert abc1 (col1, col2, col3) select col1, col2, col3 linked.server.dbo.abc1; go -- table 2 delete abc2; insert abc2 (col1, col2, col3) select col1, col2, col3 linked.server.dbo.abc2; go -- ... , on hundreds...