Posts

BNE branch in MIPS assembly -

right i'm preparing test in computer architecture, , being stuck in task don't understand. * $1=4, $2=2, $3=x here's code loop: addi $2,$2-1 sll $2,$2,2 mult $3,$1 mflo $3 sw $3, 0($2) bne $2,$1,loop my question is, value $2 have after this? 4 or 4x? maybe clearer if write out ordinary paper math: $1 = 4 $2 = 2 $3 = x loop: $2 = $2 -1 $2 = $2 * 2^2 $lo = $3 * $1 $3 = $lo "contents of memory address in $2" = $3 if $2 != $1 goto loop

Visual Studio, csproj: How can I specify a linked file in DependentUpon? -

suppose have default.aspx.cs in project, want make dependent upon default.aspx file that's linked. e.g.: <content include="..\somedir\default.aspx"> <link>default.aspx</link> </content> this doesn't work: <compile include="default.aspx.cs"> <dependentupon>default.aspx</dependentupon> <subtype>aspxcodebehind</subtype> </compile> this doesn't work: <compile include="default.aspx.cs"> <dependentupon>..\somedir\default.aspx</dependentupon> <subtype>aspxcodebehind</subtype> </compile> for both, error: the parent file, 'default.aspx', file 'default.aspx.cs' cannot found in project file. is possible have file dependent upon linked file? i tried same thing , seems not supported. check this: https://bitbucket.org/jfromaniello/nestin/issue/4/error-when-nesting-linked-files "dependentupon ...

express session - Error: Connection strategy not found MongoDB -

here simple connection use express session store, keeps banging out error though text right book. pretty sure has 'new mongostore' object initialization. var express = require('express'), expresssession = require('express-session'); var mongostore = require('connect-mongo/es5')(expresssession); var sessionstore = new mongostore({ host: '127.0.0.1', port: '27017', db: 'session' }); var app = express() .use(expresssession({ secret: 'my secret sign key', store: sessionstore })) .use('/home', function (req, res) { if (req.session.views) { req.session.views++; } else { req.session.views = 1; } res.end('total views you:' + req.session.views); }) .use('/reset', function(req, res) { delete req.session.views; res.end('cleared views'); }) .listen(3000); add url new mongostore()...

linked list - C++ Linker Errors (LNK 2019: unresolved external symbol) / Project Specific -

main issue i trying build homework project involving linked lists , custom classes, when build project, following 3 linker errors... 1>customerimp.obj : error lnk2019: unresolved external symbol "class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl operator<<(class std::basic_ostream<char,struct std::char_traits<char> > &,class linkedlisttype<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > const &)" (??6@yaaav?$basic_ostream@du?$char_traits@d@std@@@std@@aav01@abv?$linkedlisttype@v?$basic_string@du?$char_traits@d@std@@v?$allocator@d@2@@std@@@@@z) referenced in function "public: void __thiscall customertype::printrentedvideo(void)" (?printrentedvideo@customertype@@qaexxz) 1>testvideostore.obj : error lnk2019: unresolved external symbol "class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl o...

VIM Always Use Tabbed Pages -

i command can put in ~/.vimrc file make vim open in tabbed pages mode without having pass -p on command line. is there such command? if not, there better way this. currently, i'm using alias vi='vim -p' in bash profile. thanks..... setting following in ~/.vimrc , source ~/.vimrc au vimenter * if !&diff | tab | tabfirst | endif works being mentioned here or set alias in rc file e.g. ~/.bashrc . approach take. alias vim='vim -p' alias vi='vim -p'

MultipleApiVersions with Swagger -

i trying enable versioning on rest api, version specified in header, "api-version":2 , vendor media type, "accept: application/vnd.company.resource-v2+json , application/json; version=2" , or in query string "?version=2" . implementation using ihttprouteconstraint , routefactoryattribute. works perfectly. however, swagger not able match right model correct versioned document. operationid version 1 model. public class devicescontroller : apicontroller { [httpget, routeversion( "api/devices", 1, name = "v1.devices" )] [responsetype( typeof( ienumerable<models.v1.device> ) )] public ihttpactionresult getv1( ) { return ok( new list<models.v1.device> { ... } ); } [httpget, routeversion( "api/devices", 2, name = "v2.devices" )] [responsetype( typeof( ienumerable<models.v2.device> ) )] public ihttpactionresult getv2( ) { return ok( new list<...

python - Modifying a variable in a function has no result -

i have tkinter application, have mainloop typical of tkinter, , various functions handle mouse clicks , garbage. in 1 of functions, generate string , want store string somewhere in program, can use later on if other function called or maybe if want print main loop. import , that, here , there etc etc #blah blah global declarations fruit = '' def somefunction(event): blahblahblah; fruit = 'apples' return fruit mainwin = tk() #blah blah blah tkinter junk #my code here #its super long don't want upload #all of works, no errors or problems #however button = button( blahblahblha) button.bind("<button-1", somefunction) print fruit #yields nothing mainwin.mainloop() this abridged example. else in program works fine, can track variable throughout program, when it's time saved later use, gets erased. for example, can print variable pass along 1 function argument, , fine. preserved, , prints. instant try loop or store later u...