Posts

c# - Grid related UI design question -

grid related ui design question i want 16-grid (4 rows , 4 columns) user interface, , fill grid round shapes. want use mouseover, mouse left button down, , mouse left button events set state of grids selected or not selected. my questions: 1. how fill grid round shapes? setcolumn , setrow? 2. how make grids respond mouse please? thanks <grid.columndefinitions> <columndefinition /> <columndefinition /> <columndefinition /> <columndefinition /> </grid.columndefinitions> <grid.rowdefinitions> <rowdefinition /> <rowdefinition /> <rowdefinition /> <rowdefinition /> </grid.rowdefinitions> i'd suggest initialize grid in code instead of xaml. since need pretty repetitive stuff (4×4 shapes, each 1 hooked same event handlers) don't want in xaml. you can use grid.setrow , grid.setcolumn position controls create. ...

silverlight 4.0 - DataTemplateSelector issue -

in silverlight project, needed use datatemplateselector . found way implement (as it's not present in framework) here : http://www.codeproject.com/kb/silverlight/sltemplateselector.aspx this method has been working correctly in other places of code, time doesn't work. problem templateselector never called (i tried put breakpoint in constructor, never hit). can see problem in code ? used debug converter, , see listbox 's itemssource correctly set. thanks in advance ! xaml: <listbox name="destinationslist" grid.column="2" itemssource="{binding}"> <listbox.itemtemplate> <datatemplate> <helper:targettemplateselector content="{binding}"> <helper:targettemplateselector.firsttemplate> <datatemplate> <textblock text="test1" /> </datatemplate> </helper:targettemplateselector.f...

c# - Which Namespaces Must Be Used to Connect to SQL Server with ADO.NET? -

i using example connect c# sql server. can please tell me have include in order able use sqlconnection? it must like: using sqlconnection; ??? string connectionstring = @"data source=.\sqlexpress;attachdbfilename=""c:\sql server 2000 sample databases\northwnd.mdf"";integrated security=true;connect timeout=30;user instance=true"; sqlconnection sqlcon = new sqlconnection(connectionstring); sqlcon.open(); string commandstring = "select * customers"; sqlcommand sqlcmd = new sqlcommand(commandstring, sqlcon); sqldatareader datareader = sqlcmd.executereader(); while (datareader.read()) { console.writeline(string.format("{0} {1}", datareader["companyname"], datareader["contactname"])); } datareader.close(); sqlcon.close(); using system.data; using system.data.sqlclient;

rest - HttpContext in WCF -

i have written simple rest api in wcf, , authentication mechanism uses api key. once client submits api key in request header, check on server side (in baseservice class overriding processrequest() method of requestinterceptor class) follows: public partial class baseservice : requestinterceptor { public baseservice() : base(false) { } #region process request public override void processrequest(ref requestcontext requestcontext) { if (isvalidapikey(requestcontext)) //put values in httpcontext object. } ... now have enabled aspnet compatibility in rest services, still cannot access httpcontext object in processrequest override above. note httpcontext accessible inside service method, not in processrequest method. any ideas why? the httpcontext initialized later in wcf channel stack. remember channel interceptor runs in channel stack before else, , after message has been received http channel listener. need access httpcontex...

mysql - Ordering by top commented -

how list page of top commented pages on site php , mysql? the database set sort of this: page_id | username | comment | date_submitted --------+----------+---------+--------------- 1 | bob | hello | current date 1 | joe | byebye | current date 4 | joe | stuff | date 3 | mark | | date how query orders them top commented pages? here simple query start (with xxx being areas think need with): $querycomments = sprintf("select * comments " . "xxx = %s order xxx desc", getsqlvaluestring(????????????, "text")); well, if you're looking way list pages in order of comments, group page id , order count, like: select page_id, count(*) comments group page_id order 2 desc, 1 asc technically, don't need 1 asc ensure specific order within descending comment count. so, if lot of pages identical comment count appear, can locate specific page within group easily. in other words, if...

SSIS package items show up empty when I open project -

i'm sorta new ssis packages , i've come across problem. i've taken on project coworker left. zipped project , left on machine. problem when unzip , open project on machine, data flow portion of items gone! theres nothing there! if, however, unzip , open project on machine, stuff put in there. heck going on? ssis packages stored xml. no matter open from, package should open - may give error if components needs missing, data flow not going go awol because doesn't desktop wallpaper. maybe question of zooming. on machine, when package opens up, right click in yellow area, , context menu choose zoom , fit other that, verify actual project path of each project in solution on workstation vs yours.

gcc - Netbeans is failing to build (How do I point it to my new Open MPI library?) -

i doing c development using netbeans on os x , project fails build, stating "...this installation of open mpi not compiled fortran 90 support" i have installed newer gcc , open mpi (along side default versions), , can build using them via make on command line. leads me believe netbeans using default open mpi installation (which did not have fortran support). if correct, how use new installation? told netbeans other compilers via tool collection manager (file->project properties->build->tool collection->[...]). however, not know of way tell open mpi. i have working solution. solution exists in 2 parts. 1) reran configure on command line project , specified full paths mpicc , mpifc. solved problem of getting netbeans use right mpicc compiler. however, created issue: mpif90 wrapper not find gfortran. 2) altered 'gui environment' path variable put gfortran in path using /etc/launchd.conf method found here (http://stackoverflow.com/questions/...