Posts

c# - Am I building the wrong entities in MVC? -

goal. have "gift" entity describes has offer (babysitting, dog walking, etc) rating. , want "giftcategory" entity gives general category descriptive information (pets, sports, automotive, etc) search apon , gift have categories. "gift" entity can have multiple "giftcategory" entities associated it. want ability search category , pull out "gift" entities have been created categories associated them. here have far doesn't seem work entity first approach. maybe need table connects 2 entities because way 2 tables connected doesn't seem correct? gift entity: public class gift { public int id { get; set; } public string name { get; set; } public icollection<giftcategory> categories { get; set; } // incorrect??? public int rating { get; set; } } category entity: public class giftcategory { public int id { get; set; } public string name { get; set; } public string description { get; set; } }...

html - Fixed sidebar but responsive layout -

this preview of website i'm working on: http://jsfiddle.net/x4yc8/ it has fixed (full height) sidebar scrolling main content section. when width of window reduced (see screenshot below) main content overlaps sidebar. how ensure doesn't happen? http://imgur.com/sgy5ken ideally main content appear below sidebar when screen width e.g. when viewed on mobile-sized screen thanks in advance! my code is: css /* css document */ @import url(http://fonts.googleapis.com/css?family=open+sans); html, body { height:100%; margin: 0px; padding: 0px; color: #fff; background-color: #06c; } #sidebar { width: 250px; height: 100%; left: 0; float:left; background-color: #006; padding-top: 25px; position: fixed; clear: right; } section#settings { width:auto; float:left; margin-left:250px; padding-top: 60px; padding-right: 25px; padding-bottom: 25px; padding-left: 25px; position: absolute; } #...

python - Sharing variables between urlpatterns in Django -

here urls.py from django.conf.urls import patterns, url, include geartables import views geartables.views import datatable urlpatterns = patterns('', url(r'^$', views.index, name='index'), url(r'^data/$', datatable.as_view(), name='datatable'), url(r'^(?p<product_type>[\w\-]+)/$', views.table, name='table'), ) when user goes "localhost/table/", page generated template. within template {% url %} tag calls datatable class (to create json data). so question how can datatable class in views.py call variable? like so: class datatable(basedatatableview): model = <product_type> ... edit: views.py: ... def table(request, product_type): ptype = producttype.objects.get(url_name=product_type) datatable = 'datatable' context = {'mselectmenus': ptype.mselects, 'columns': ptype.columnlist,...

objective c - I can't figure out the meaning of this statement: -

+(appdelegate*)instance{return [uiapplication sharedapplication].delegate; it's in middle of appdelegate using template. if has time, please explain line or usefulness of it. thank patrick it utility method: when in need of instance of application's delegate casted correct class call: [appdelegate instance] instead of: appdelegate* instance = (appdelegate*)[uiapplication sharedapplication].delegate;

javascript - Transform a lodash/underscore collection in a jQuery object (chaining) -

i seamlessly wrap lodash collection in jquery object. right i'm saving lodash output in variable , feeding jquery: //simplified code var els = [document.getelementbyid('a'), document.getelementbyid('b')]; els = _(els) .map(dostuff) .map(domorestuff); var $els = $(els); but chain instead: //pseudo code _(els) .map(dostuff) .map(domorestuff) .jqueryfy() //this magic method, missing .show() //jquery method, right away i thought possible tap , doesn't change collection. _(els) .map(dostuff) .map(domorestuff) .tap(function(array) { return $(array); }) //doesn't return jquery object .show() this should using mixin jquery constructor take array of dom elements: _.mixin({jqueryfy: jquery}, {chain:false}); notice jquery support basic collection manipulation functions , could've written example as $("#a, #b").map(dostuff).map(domorestuff).show();

unique - Uniquely identify instruction in LLVM -

is there way uniquely identify given instruction in llvm. example, if have function , inside function have "add" instruction, there way same "add" instruction every time execute it? thank what mean "execute" it? if execute in interpreter (via lli ), yes, each llvm instruction unique value* . if compile down machine code , execute it, can use debug info correlate between llvm instruction , machine code generated it. it's trickier, doable. complications multiple machine code instrs generated same llvm instruction, etc.

java - Setting a .bat file to run at windows shutdown doesn't work -

i need run java application @ windows shutdown. have windows 7 , have tried in 2 ways: i have created .bat file containing following: javaw -xmx200m -jar c:\path\to\jar\dl.jar dl.jar application need run @ shutdown , added in local group policies->windows settings->scripts(stratup/shutdown)->shutdown->script name batch file, doesn't work. also have added in shutdown scripts local group policies @ script name: c:\windows\system32\cmd.exe , @ script parameters path batch file, doesn't work in way either if run .bat file command promt works. have idea how make work?