Posts

Using windows DDK with C# -

for little background story, work in computer lab , need have easy method disable network protocol bindings on adapters based on pci bus locations. so far have written c# command line utility find them, bus locations, netcfginstanceid, etc. 1 thing haven't figured out how remove bindings on adapters, go through , remove them in registry still show in adapter settings. eventually found out neat utilities in windows ddk, bindview sample program, want take netcfgapi included in bindview sample , use in c# program, problem c++ files. have tried using midl convert them .ddl or .tlb can use pinvoke on know little pinvoke , midl compiler comes errors such "midl : command line error midl1003 : error returned c preprocessor (4)". my question is, there easier way this? , if there not, best way go converting netcfgapi c++ files usable in c#? i write utility in c++ more comfortable using c#. you try compiling stuff c++/cli dll. in project settings under compiler,...

make is automatically attempting to link even when I pass -c in my makefile -

i'm new makefiles, apologize in advance if silly question. removed variables makefile because weren't working (gnu make tells me $(myvar) should replaces value of myvar, output of make showing me not happening), apologize ugliness , more 80 character lines. acolibobj = acolibinit acoglobaldefs acolibinterface: $(acolibobj).o acolibinit.o: gcc -fpic -g -c -wall -i/usr/include/dc1394 -o acolibinit.o acocommands/acolibinterface/acolibinit.c acoglobaldefs.o: gcc -fpic -g -c -wall -i/usr/include/dc1394 -o acoglobaldefs.o acocommands/acolibinterface/acoglobaldefs.c when run makefile get: gcc -fpic -g -c -wall -i/usr/include/dc1394 -o acolibinit.o acocommands/acolibinterface/acolibinit.c cc acolibinit.o -o acolibinit gcc: acolibinit.o: no such file or directory gcc: no input files make: *** [acolibinit] error 1 so far can tell, what's happening make trying compile , link, though explicitly added -c flag. when run "gcc -fpic -g -c..." myself (from ...

c - OpenGL - Frame Buffer Depth Texture differs from Color Depth Texture -

i'm doing shadow mapping in opengl - such i've created frame buffer object render depth of scene view of light. glbindrenderbuffer(gl_renderbuffer, color_buffer); glrenderbufferstorage(gl_renderbuffer, gl_rgba, width, height); glframebufferrenderbuffer(gl_framebuffer, gl_color_attachment0, gl_renderbuffer, color_buffer); glbindrenderbuffer(gl_renderbuffer, depth_buffer); glrenderbufferstorage(gl_renderbuffer, gl_depth_component24, width, height); glframebufferrenderbuffer(gl_framebuffer, gl_depth_attachment, gl_renderbuffer, depth_buffer); glgentextures(1, &color_texture); glbindtexture(gl_texture_2d, color_texture); glteximage2d(gl_texture_2d, 0, gl_rgba, width, height, 0, gl_rgba, gl_unsigned_byte, null); gltexparameteri(gl_texture_2d, gl_texture_min_filter, gl_nearest); gltexparameteri(gl_texture_2d, gl_texture_mag_filter, gl_nearest); gltexparameteri(gl_texture_2d, gl_texture_wrap_s, gl_clamp); gltexparameteri(gl_texture_2d, gl_texture_wrap_t, gl_clamp); glfra...

In Rails 3 how can I select items where the items.join_model.id != x? -

in rails models have: class song < activerecord::base has_many :flags has_many :accounts, :through => :flags end class account < activerecord::base has_many :flags has_many :songs, :through => :flags end class flag < activerecord::base belongs_to :song belongs_to :account end i'm looking way create scope in song model fetches songs not have given account associated it. i've tried: song.joins(:accounts).where('account_id != ?', @an_account) but returns empty set. might because there songs have no accounts attached it? i'm not sure, struggling one. update the result set i'm looking includes songs not have given account associated it. includes songs have no flags. thanks looking. am understanding question correctly - want songs not associated particular account? try: song.joins(:accounts).where(account.arel_table[:id].not_eq(@an_account.id)) answer revised: (in response clarification in comments) yo...

asp.net - javascript function "createCallback" called >50 times when I use addClass/removeClass in Firefox -

i'm working on web app in asp.net 2.0 involves several gridview elements. when users click 1 of rows in grid, row needs show selection changing color. each row has attributes set identify record type , unique id: <tr data-elementtype='mytype' data-myid='12' onclick='selectionfunction();'></tr> i accomplish selection through javascript onclick handler on each row calls function that: removes selected class selected row adds selected class new selected row updates value of hidden field new selected unique id server-side code can know element perform action on when button clicked (view, delete, etc). one of these grids has on 700 records in it. in firefox 3.6, selection operation on grid horribly slow (about 2 seconds); in other browsers (even ie 7 , 8) it's not problem. put console.log statements @ start , end of selection function, , in firebug show fast @ end of delay, suggesting it's not selection function slowin...

php - The best way to do a 301 redirect with a delay of several seconds? -

what best way 301 redirect delay of several seconds? want original page displayed 5-10 seconds , 301 redirect site. i've found lot of solutions in php on google 1 found delay didn't display original page before redirecting—only empty screen. you can't true 301 redirect delay. http stateless. "301 redirect", want if you're trying make google happy; client sends request, , status code on reply server 301, part of reply you'll use location header , tell new content is. if don't have that, you're not doing 301 redirect. with other answer, you're doing meta refresh on client side, google not like. this how 301, , user doesn't see old page @ all, , have no idea they've been redirected. $location="http://www.yoursite.com/newpage"; header ('http/1.1 301 moved permanently'); header ('location: '.$location);

asp.net - Best Practices when using .NET Session for temporary storage? -

i'm still relatively new .net , asp.net mvc, , have had few occasions nice store information retrieved db temporarily can used on subsequent server request client. have begun using .net session store information, keyed off of timestamp, , retrieve information using timestamp when hit server again. so basic use case: user clicks 'query' button gather information system. in js, generate timestamp of current time, , pass server request on server, gather information db on server, use unique timestamp client key session store response object. return response object client user clicks 'generate report' button (will format query results excel doc) pass same timestamp #2 down server again, , use gather query results #4. generate report w/o additional db hit. this scheme have begun use in case use session temporary storage. generating timestamp in js isn't secure, , whole things feels little... unstructured. there existing design pattern can use this, ...