Posts

visual studio 2010 - MSVS : C++ : Allegro 5 template : Agui GUI API : How to setup includes? -

i use allegro 5 library work graphics in c++ in microsoft visual studio. found great allegro 5 template called "agui gui api" have struggled understand how set up. extreme beginner when comes setting coding environment. following me lot. recommendation keep agui files , if copy them each new project? how include them in msvs compile , run agui_example.cpp? files: https://code.google.com/p/agui/ i found looking here: windows, visual studio 2010 , allegro 5 - allegro wiki

windows phone 8 - Best approach for playing a single tone audio file? -

can tell me best approach playing single-tone, audio (.mp3) files in windows phone 8 app? think of piano app, each key represent button, , each button play different tone. i'm looking efficient way go - i've got 8 different buttons need play different tone when tapped. i tried using mediaelement : mediaelement me; public mainpage() { initializecomponent(); me = new mediaelement(); me.autoplay = false; me.source = new uri("/sounds/sound1.mp3", urikind.relative); btnplay.click += btnplay_click; } private void btnplay_click(object sender, eventargs e) { me.play(); } but nothing happens, either in emulator or on device (testing w/ lumia 822). doing wrong here? seems should pretty simple. or using mediaelement best thing use scenario? would fall under background audio category? i've read through example seems overkill want do. i've read using xna's soundeffect job, i'd have convert .mp3 files .wav (which isn...

asp.net mvc - Why class attribute not work in WebAPI? -

i used default asp.net mvc4 web application template , visual studio create initializesimplemembershipattribute in filters directory , create account controller this: [authorize] [initializesimplemembership] public class accountcontroller : controller { /* default actions login, logoff, register, ...*/ } and try make accountcontroller webapi, code is: [authorize] [initializesimplemembership] public class apiaccountcontroller : apicontroller { [system.web.http.acceptverbs("get", "post")] [system.web.http.httpget] [system.web.http.httppost] [system.web.http.allowanonymous] [system.web.mvc.validateantiforgerytoken] public string login(string username, string password, bool rememberme) { if (websecurity.login(username, password, persistcookie: rememberme)) { return "ok"; } return "failed"; } } now, when call api, break in line: if (websecurity.login(username, ...

Bootstrap starter template collapsed menu doesn't highlight properly -

just displaying url http://twitter.github.io/bootstrap/examples/starter-template.html# correctly don't understand (ok i'm starting bootstrap) when reduce browser window size, menu button, menu displayed home option highlited correctly when hovering on it. put js @ end of body , jquery before bootstrap.js. same thing firefox or chrome , internet explorer 10 demo not responsive menu button doesn't appear nav stay same. regarding point links don't change on hover screens < 980px wide, i'm not sure if behaviour intentional or not, it's coming line 1028 of bootstrap-responsive.css if want link colors change on hover, edit styling below force color #fff: .navbar-inverse .nav-collapse .nav > li > a:hover, .navbar-inverse .nav-collapse .nav > li > a:focus, .navbar-inverse .nav-collapse .dropdown-menu a:hover, .navbar-inverse .nav-collapse .dropdown-menu a:focus { background-color: #111; color: #fff; } the color home link special ca...

php - Background is turning out black -

i have done possibly try fix this. i've spent on hour researching , trying code, nothing has helped. this code following. take 2 completely-white images , re-color them ( while keeping transparency ) merge 2 images together outputs images (but with black background!!) can identify , patch part that's causing black background? see following url example of script. http://labs.bluefiremedia.net/metro-machine/gd/download-png.php?size=128&padding=29&icon=icons/application/add-new.png&bgshape=circlebg.png&bgcolorr=255&bgcolorg=0&bgcolorb=0&iconcolorr=255&iconcolorg=255&iconcolorb=255 $final_image = imagecreatetruecolor($dimensions, $dimensions); imagesavealpha($final_image, true); if($bgshape != '') { list($originalwidth, $originalheight) = getimagesize('../images/' . $bgshape); $background = imagecreatefrompng('../images/' . $bgshape); imagefilter($background, img_filter_brightness, -255); imagefilter...

graph - Algorithms: Esau-Williams algorithm -

i ask there sittuations esau-williams algorithm may useful? know used solve cmst problem, can't find sittuation cmst problem may appear. according wikipedia , "cmst problem important in network design: when many terminal computers have connected central hub, star configuration not minimum cost design. finding cmst organizes terminals subnetworks can lower cost of implementing network."

xmlhttprequest - Refused to get unsafe header "Content-Range" -

for reason cannot access response header of "content-range" anymore... therefore it's impossible determine file size of resource using xhr. error refused unsafe header "content-range" on chrome in line: var cr = this.getresponseheader('content-range'); here's cors config: <?xml version="1.0" ?> <corsconfig> <cors> <origins> <origin>*</origin> </origins> <methods> <method>get</method> <method>head</method> <method>delete</method> </methods> <responseheaders> <responseheader>x-goog-meta-foo1</responseheader> <responseheader>origin</responseheader> <responseheader>range</responseheader> <responseheader>content-range</responseheader> <responseheader>content-length</responseheader> </...