Posts

WPF MVVM - create model from database -

i heard suitabale solution situation. i use in wpf app caliburn.micro framework. need have acess sql compact db. on db access use linq sql. for example in view have combobox control or listbox control. need load items of these controls db. so create simple class on access db. [export(typeof(idbmanager))] public partial class dbmanager : idbmanager { public ilist<spirit_users> loadspiritusers() { var result = u in _dc.spirit_users orderby u.nick select u; return result.tolist(); } } i inject class mef view model class. on use method class on db access in view model class on load items combobox. [export(typeof(ilogonviewmodel))] public class logonviewmodel : screen, ilogonviewmodel, ipartimportssatisfiednotification { [import] internal idbmanager dbmanager { get; set; } //this property bind on listbox or combobox public bindablecollection<spirit_users> spiritusers { { return _spiritusers; } ...

cakephp - Cake Bake error -

Image
i trying use cakes baking console , when use cake bake model all i getting following error attendance table structure create table if not exists `mydb`.`attendences` ( `id` int(11) unsigned not null auto_increment , `datetime` datetime null , primary key (`id`) ) engine = innodb; rather baking @ once, table-by-table , model-controller-view separately. way you'll able pin down error. have created fixtures correctly? see http://book.cakephp.org/view/360/creating-fixtures , check syntax correct, particularly in array definitions.

winforms - Bool property not serializing when set to false in inherited form -

i have inherited form has bool property toggles controls on , off , should visible in designer. problem property value seems serialized designer code when it's set true. if it's set false nothing gets generated, because it's default value. i've tinkered around designerserializationvisibility , defaultvalueattribute attributes doesn't seem ... i don't know if may help, i've had similar question answered. if go link below can see thread. autosize set false in designer

I don't understand some old C array concatenation -

i don't understand syntax in old c program, , not set test code see does. part confused concatenation array. didn't think c handle auto-typecasting that, or making difficult in head being friday afternoon... char wrkbuf[1024]; int r; //some other code //below, vrec 4 byte struct memcpy( &vrec, wrkbuf + r, 4 ); any idea happen here? wrkbuf become when concatenate or add int it? wrkbuf + r same &wrkbuf[r] essentially wrkbuf when used in expression wrkbuf + 4 "decays" pointer first element. add r it, advances pointer r elements. i.e. there's no concatenation going on here, it's doing pointer arithmetic. the memcpy( &vrec, wrkbuf + r, 4 ); copies 4 bytes wrkbuf array , starting @ r th element memory space of vrec

php - Impact of Share Button on Web Page Performance -

on few websites maintain, noticed adding share button addthis page varyingly slows down page loading, significantly. what explanation , can done keep share buttons while not incurring page loading performance penalty this? add script call bottom of page, that's do, right on top of </body> . ... html ... <!-- addthis button begin --> <div class="addthis_toolbox addthis_default_style "> <a href="http://www.addthis.com/bookmark.php?v=250&amp;username=xa-4d4c6a9028bcda9b" class="addthis_button_compact">share</a> <span class="addthis_separator">|</span> <a class="addthis_button_preferred_1"></a> <a class="addthis_button_preferred_2"></a> <a class="addthis_button_preferred_3"></a> <a class="addthis_button_preferred_4"></a> </div> <!-- addthis button end --> ... html ... <script typ...

codeigniter - auth tank 1.0.7 -

recently went 1.0.8 new codeigniter 2.0 release. still use codeigniter 1.7.3 , finding auth tank 1.0.8 doesnt work it. tried looking version history on auth tanks website couldn't . 1 know can auth tank 1.0.7? you should able access svn repository here , using svn client (tortoise svn or whatever) go in revisions , versions 1.0.7. here repo: https://tankauth.svn.sourceforge.net/svnroot/tankauth/ - although, issues having 1.0.8 anyway? error messages getting? the issue fact ci 2 introduced changes how controllers , models extended. in ci 1.7.2 / 1.7.3 controllers , models extended controller , model respetively, in ci 2 controllers extend ci_controller , models extend ci_model. maybe go through code , make sure tank auth extending latter , not ci_ prefixed controllers , models. also in ci 2 models , controllers call parent class via parent::__construct(), in ci 1.7.x contructor functions called parent class this: parent::controller() , parent::model(). i think ...

How to define an extern, C struct returning function in C++ using MSVC? -

the following source file not compile msvc compiler (v15.00.30729.01): /* stest.c */ #ifdef __cplusplus extern "c" { #endif struct test; /* nb: may extern when imported module. */ struct test make_test(int x); struct test { int x; }; struct test make_test(int x) { struct test r; r.x = x; return r; } #ifdef __cplusplus } #endif compiling cl /c /tpstest.c produces following error: stest.c(8) : error c2526: 'make_test' : c linkage function cannot return c++ class 'test' stest.c(6) : see declaration of 'test' compiling without /tp (which tells cl treat file c++) works fine. file compiles fine in digitalmars c , gcc (from mingw) in both c , c++ modes. used -ansi -pedantic -wall gcc , had no complaints. for reasons go below, need compile file c++ msvc (not others), functions being compiled c. in essence, want normal c compiler... except 6 lines. there switch or attribute or can add allow work? the code in qu...