Posts

Showing posts from September, 2012

wpf - Is it possible to cache the view when using model first approach? -

in our product, use mvvm model first approach , works nicely 1 caveat. when view becomes complex takes time create data template. if view shown , hidden frequently, becomes irritating. if using view first, easy enough cache view if needed - when using datatemplate , model first, not have control of view creation. solved problem without switching view first method? with viewmodel first approach think have no chance "cache" view. may consider use view first , viewmodel locator heavyweight datatemplates workflows. here solution when using datatemplates lists. but maybe there solution overriding wpf datatemplate mechanism? edit: if create "markerview" viewmodel, wpf datatemplate can find it. , within marker view create/rehydrate real view? view service locator?

list - How can I parse a csv file and fit it to an existing table in C#? -

okay, right have parsecsv function returns table me in 2d format so: list<string[]> data = parsecsvfle(file); now, i'd rows in 'data' arranged in particular order. order determined first column in temp (i.e. first element of string array). order maintained in string array elsewhere. string[] dogs = {"rottweiler", "germanshepherd", "dalmatian"}; how rearrange 'data' reflect order in 'dogs'? additional constraints include the string in 'dogs' may substring of string in 'data'. in case, string 'dogs' displayed. the string in 'dogs' may not present in 'data' @ all. in case, string 'dogs' added 2d table blanks in other columns. example data data_initial dalmatian 45 52 rottweiler 58 data_final rottweiler 58 - germanshepherd - - dalmatian 45 52 thanks looking, all. if understand correctly want sort content of rows header entry, 1 of dogs -...

javascript - JS/Ajax - Change page with PHP in ajax -

ive got ajax type script changing div content data php file using xmlhttp: function updatelog() { request = 'messages.php?new='+first+'&time='+lastupdate+'&user='+user; xmlhttp.open("get", request ,false); xmlhttp.send(); document.getelementbyid("messages").innerhtml=document.getelementbyid("messages").innerhtml+xmlhttp.responsetext; lastupdate = time(); first = 0; document.getelementbyid("messages-window").scrolltop = document.getelementbyid("messages-window").scrollheight; } i want redirect user using header( 'location: kick.php' ); redirects xml request, not whole page. how can redirect whole page , not request? use javascript redirect window.location = "kick.php"

c# - Looking for a good WPF solution for a transparent, click-through overlay -

i want try different, , attempting display overlay on top of current wpf gui allows user still interact gui, provides layer of annoyance let them know something's up. my question 2 separate questions: 1. how overlay? my first attempt use rectangle, set fill appropriate color, , change opacity. it's not transparent click-throughs. think want do, according search results, create separate window, set background transparent, , set allowstransparency true. while works, if want background="darkred" opacity="0.2" , click-throughs no longer work . and leads me second part: 2. what's right way resize overlay region if i'm using mvvm? my main window creates viewmodel, creates model. model thing knows whether or not overlay should displayed. main window thing knows size, , model never knows above it. way achieve databind overlay window's size properties in viewmodel, , have viewmodel set these values time main window's size chang...

php - Using backtrace_debug to determine caller class and caller method for the function. Am I doing it wrong? -

i have parent class , children class. in parent class define function f() , want print in name of children class extended parent class , name of children method called function. that. abstract class parentclass { public function f() { $backtrace = debug_backtrace(); echo "class: " . $backtrace[1]['class']) . "\n"; echo "function: " . $backtrace[1]['function']; } } class childrenclass extends parentclass { public function some_func() { $this->f(); } } $o = new childrenclass; $o->some_func(); and correctly outputs me: class: childrenclass function: some_func the question is: solution appropriate or there better way achieve this? tried use __class__ , __function__ gives me classname , function name of parent class. if print out $backtrace var might see goes more classes echo "debug:<pre>".print_r($backtrace,true)."</pre><br />...

.net - When my large ASP.NET site is updated, IIS has to recompile a lot of it. Is there a way to cut down my compile time significantly? -

dotnetnuke large asp.net cms pre-compiled, of modules contained within. when deploy our dotnetnuke site changes, have 2 bits of recompilation occur upon first page hit. application-level recompilation occurs when dll replaced in bin folder each time individual module accessed first time, recompiling occurs on specific module. is there way allocate more of cpu capacity compiling asp.net sites in iis 7? i'd use more 1 core, or @ least reduce recompile time. q&a you should use pre-compiled asp.net. why aren't you? we using pre-compiled asp.net. because asp.net app compiled dll not mean asp.net runtime not additional recompiling in order serve vistiors. how know it's recompiling , not populating cache or something? viewing task manager on server shows 50% cpu usage compiler executable during aforementioned page hits. why 50%? 2-core server. set <compilation optimizecompilations="true" /> specifies whether dynami...

actionscript 3 - click on color button and write in textarea with that color font -

i want follows: * click "red" button * write in textarea red color font * click "blue" button * write in textarea blue color font isn't possible in flash 10 using as3 ?????? i tried using settextformat problem have have text before inserting format on that. this want: * start writing in textarea white color (eg: "abc") * click blue color button * start writing in textarea blue color (eg: "abcdef" - abc in white , def in blue) * click red color button * start writing in textarea red color (eg: "abcdefxyz" - abc in white , def in blue , xyz in red) please tell me how this? the documentation states if want change format of text prior writing in text field assign new defaulttextformat. otherwise, setting new format change current selection. the solution below works maintaining focus on text field, when buttons clicked text field still has focus. if there current selection, selection change either blue or red...

django - Setting the variable 'db_table' does not include the app prefix to table names -

when using 'db_table' explicitly set database table name, how can preserve naming convention of "app_table_name"? app name removed. as far know db_table option precedence on existing convention of app name + model name. if set explicitly have prefix app name yourself .

python - determining whether a MIME type is binary or text-based -

is there library allows determining whether given content type binary or text-based? obviously text/* textual, things application/json , image/svg+xml or application/x-latex it's rather tricky without inspecting actual data. there's wrapper libmagic python -- pymagic . thats easiest method accomplish want. keep in mind magic fingerprint. can have false-positives if 'looks' file format, cases pymagic give need. one thing watch out 'simple solution' of checking see if of characters 'outside' printable ascii range, encounter unicode binary (and in fact, binary) though it's textual content.

Scrollable TextView in Android Widget -

i create android widget scrollable textview. the solutions given question making textview scrollable on android cannot applied because widget: 1. this findviewbyid(r.id.textview).setmovementmethod(new movementmethod()); does not work, since findviewbyid not available in appwidgetprovider in activity . 2.putting scrollview around textview not work, because inflateexception : android.view.inflateexception: binary xml file line #23: error inflating class scrollview can give me hint, how make textview in widget scrollable? it looks not possible. more on can found here: http://code.google.com/p/android/issues/detail?id=9580 and here: how make scrollable app widget? so, possible make appwidgets scrollable in htc sense environment not normal android environments. a way around add buttons go , down in list.

c - Kind of sparse initialization for structures, any resources? -

i used initialize structures in way: struct a = {0}; this seems work me, argued ansi c, c89, c99 standard. couldn't find in documentation. me that? here's example works 'cl' (vs express 2008). #include <stdio.h> struct data { int a; int b; char tab[3]; }; int main(void) { struct data a; struct data b = {0}; printf("a.a: %d, a.b: %d, a.tab: %s\n", a.a, a.b, a.tab); printf("b.a: %d, b.b: %d, b.tab: %s", b.a, b.b, b.tab); }; >>>>>output: d:\n\workspace>test.exe a.a: 4203600, a.b: 451445257, a.tab: ■ b.a: 0, b.b: 0, b.tab: this 1 shows initialize first 1, rest 0's. #include <stdio.h> #include <stdlib.h> typedef struct { int a; int b; } asdf; asdf = {1}; int main() { printf("a:%d,b:%d\n",a.a,a.b); return 0; } output: a:1,b:0 you right, work. relevant section in c99 draft n1256 6.7.8 (initialization): 21. if there fe...

How to implement tabs in Android -

how implement tabs in android. having context. in want 3 tabs named free,top,paid.clicking on each of tab should open separate activity. thanks in advance, firstly, follow this tutorial android page, explain how implement few tabs what want create 3 separate activities , bind each of tab, when click on tab icon/header create intent , call startactivity on relevant activity i've had following , have documented findings on creating tabs , refreshing tab views, might helpful read you

networking - putty on windows using AF_UNIX -

i have downloaded source code putty windows client. using af_unix address family. afaik af_unix socket family not present in windows. how working here ? working on porting *nix project windows has af_unix socket family. thanks arpit the af_unix define still there in windows, when bsd socket interface ported windows microsoft, there no actual support af_unix in windows. putty in windows can not support af_unix. maybe linux port of putty can, possibly. if really, want use af_unix in windows, try develop in cygwin has user space implementation of af_unix.

WPF Choppy / Jerky Animation -

i starting work in wpf , have found animation slow , jerky on pc. running windows xp pro sp3 , have latest gpu drivers (quadro fx 1800), direct x 9 build , .net 3.5 versions. i @ loss whats going on there 2 other identical pcs in office, 1 of has same problems me, other runs fine. the code running animation sample code kaxami, running compiled app in vs 2008: http://pastebin.com/zu7zvcb5 (couldn't xaml in) so quite @ loss. anyone have similar problems, or things should compare between working pc , non working pc in terms of software versions? thanks wpf single-buffered on xp, may problem. ms wants buy vista or seven.

How to set Facebook album privacy with Graph API? -

i know if it's possible set privacy setting specific facebook album restfb java library ? thank much, regards, anthony you can set privacy settings when album created. currently, can not update settings, nor can delete existing album via api, in case wanted delete , recreate work around. http://bugs.developers.facebook.net/show_bug.cgi?id=17111 when create album, need create privacy object , include parameter in post request, json-encoded string described more in documentation of post object here: https://developers.facebook.com/docs/reference/api/post/

How to use CDATA in html documents? -

what wrong html document? <html> <body> <p><![cdata[i can't see text :(]]></p> </body> </html> why don't see text inside cdata ? explicit cdata sections are, in practice, unsupported in text/html documents. marked feature authors should avoid because have limited support . your browser treating unknown element.

cvs2svn - Previous svn log is not displayed -

firstly, have migrated cvs repository svn repository. checked out whole svn repository , make changes rearranging directories branches , tags. imported new svn repository. using following command import .. svn import svn+ssh://host/address/path repository -m "new files added" --username xyz after authenticating xyz, gets imported. now checking out repository working copy. used following command svn co svn+ssh://host/address/path repository --username xyz when svn log new files added log output. previous logs not displayed. want logs displayed.how can logs? if want retain files' history, use svn cp , svn mv in initial repository instead of importing files new repository.

3d - How do I rotate vectors using matrices in Processing? -

Image
i trying rotate vectors using matrices, got confused. i thought needed create rotation matrix , multiply vector rotated vector. here can see simple test i've done using processing : use a increment rotation, , x/y/z changes axis. and here source: pvector[] clone,face = {new pvector(50,0,50),new pvector(-50,0,50),new pvector(-50, 0, -50),new pvector(50, 0, -50)}; color facec = color(255,0,0),clonec = color(0,255,0); float angle = 90; pvector x = new pvector(1,0,0),y = new pvector(0,1,0),z = new pvector(0,0,1), axis = x; pfont ocr; void setup(){ size(400,400,p3d); strokeweight(1.1610855);smooth(); clone = rotateverts(face,angle,axis); ocr = loadfont("ocr.vlw"); } void draw(){ background(255); fill(0);textfont(ocr,10);text("a = increment rotation\nx/y/z = change axis\nrotation: " + angle + "\naxis: " + axis,10,10,200,200);fill(255); translate(width*.5,height*.5); rotatex(map(mousey,height*.5,-height*.5,0,two_pi)); rot...

gestures - Android - Detect Path of Complex Drag -

i getting android programming , want make simple game using 2d canvas drawing. have checked out lunar lander example , read on gestures, looks can detect if gesture occurred. looking little more complicated detection on swipe: i want make simple game user can drag finger through 1 or more objects on screen , want able detect objects went on in path. may start going vertically, horizontally, vertically again, such @ end of contiguous swipe have selected 4 elements. 1) there apis expose functionality of getting full path of swipe this? 2) since drawing on canvas, don't think able access things "onmouseover" items in game. have instead detect if swipe within bounding box of sprites. thinking correctly? if have overlooked obvious post, apologize. thank in advance! i decided implement public boolean ontouchevent(motionevent event) handler in code game. instead of getting full path, check see tile user on each time ontouchevent fires. thought even...

MySQL query, intersection on many-to-many relationship -

does have idea/solution how achieve this? situation is: have tables 'releases' , 'ntags', related via 'releases_ntags' (containing 'release_id' , 'ntag_id') and fetch results releases via ntag's 'slug'. i manage have semi-working: sql select r.id, r.name releases r left join ntags_releases rt on rt.release_id = r.id join ntags nt on nt.id = rt.ntag_id , (nt.name = ('tag_1') or nt.name = ('tag_2')) group r.id, r.name so far good, gives me releases "tag_1" plus releases "tag_2" (and off course both tags). but need intersection of tags, say: "releases 'tag_1' and 'tag_2'" so tried with: ... , (nt.name = ('tag_1') , nt.name = ('tag_2')) ... but leads in empty result. have idea how achieve this? don't know how go further on , appreciate input! thx you can demand 2 distinct ntags present in having clause: select r.i...

Launching application automatically in iphone 4 os -

i want build application launched automatically on particular date. there way in iphone 4.0 os. building sort of reminder send sms occasions birthday, or other event. in advance help. this isn't possible. can't it, can't bring app foreground. look push , local notifications. can create app send sms-style local notification after time. :) http://developer.apple.com/library/ios/#documentation/networkinginternet/conceptual/remotenotificationspg/introduction/introduction.html

mysql - Updating multiple rows with different values -

i got table in mysql database, 'users'. has fields 'id' , 'value'. now, want update lots of rows in table single sql query, many rows should different value. currently, i'm using this: update users set value = case id when 1 53 when 2 65 when 3 47 when 4 53 when 5 47 end id in (1,2,3,4,5) this works. feel optimization since there 3 or 4 different values i'm assigning rows. can see, right these 47, 53 , 65. there way can update rows same value simultaneously within same query? or, there way can optimize this? rather doing case variable when value ... , try doing case when condition ... - so: update users set value = case when id in (1,4) 53 when id = 2 65 when id in (3,5) 47 end id in (1,2,3,4,5)

linq - How can I return if an optional navigation property exists from an Entity Framework Query? -

i'm trying return boolean value using following query: var q = inmate in context.inmates select new { inmate.id, iscrazy = inmate.certified != null }; iscrazy should true when optional certified navigation property not null. however, iscrazy being returned true, regardless of whether there's link between inmate > certified . using above code , following data: inmate { 1 } --> { certified } inmate { 2 } --> null inmate { 3 } --> { certified } i expecting following results: 1, true 2, false 3, true however, results come true. doing wrong? i tried bring optional navigation property instead, appears inner join , only returns crazy inmates: inmate { 1 } --> { certified } inmate { 3 } --> { certified } // inmate 2 missing edit: forgot mention, using ef 4.0 code first. edit 2: this sql output select [extent1].[id] [id], case when (cast(1 bit) <> cast(0 bit)) cast(1 bit) when (...

What exactly happens when these lines of code is run + iPhone -

visitwebsitevc *visitwebsite = [[[visitwebsitevc alloc] initwithnibname:@"visitwebsitevc" bundle:nil] retain]; [self.navigationcontroller pushviewcontroller:visitwebsite animated:yes]; [visitwebsite dealloc]; what happen due [visitwebsite dealloc]. first of should never invoke dealloc method (except [super dealloc] in dealloc). you code should throw bad_access exception (retain count) alloc = 1 retain +1 = 2 push +1 = 3 dealloc = 0 but visitwebsitevc instance still in use navigation controller what should : visitwebsitevc *visitwebsite = [[visitwebsitevc alloc] initwithnibname:@"visitwebsitevc" bundle:nil]; [self.navigationcontroller pushviewcontroller:visitwebsite animated:yes]; [visitwebsite release];

c# - What does an LDAP request and response look like? -

i getting integrating app ldap , learned it's not request sent on http, it's it's own protocol? have no idea means going using plugin .net called ip works nsoftware.com. can tell me 1 of these requests looks , response like? form data in, text? talked our partner has ad , said need ip , port , need tell them ip of server (this makes sense me). don't ldap request is. preferable example showing me request contains username , password , response comes users data. need generate such request form , parse response database. also, 'secure ldap' mean, kind of credentials going need make these requests , how 'into' request? if want learn ldap (assuming has configured ldap server you), i'd suggest using ldap browser, example apache directory studio . there multiple security aspects regarding ldap. first, there's security of communication itself. can done in 2 ways: using ssl or tls upfront, using ldaps:// uri (port 636 default) or using ...

c# - Making AJAX call back in ASP.NET with jQuery -

Image
i accept both c# , vb.net if visit http://www.eol.org/pages/983558 , click on link image below you'll see in-line pop-up div displays busy status of ajax callback before displays information. so, information not there yet until click on link. i'd same asp.net , jquery. if there's place me started on right track? thanks. using jquery directly call asp.net ajax page methods $.ajax({ type: "post", url: "pagename.aspx/methodname", data: "{}", contenttype: "application/json; charset=utf-8", datatype: "json", success: function(msg) { // interesting here. } }); i think place start.

SQL Server char(1) and char(2) column -

i need table bookkeeping types in data model. don't have many types fair deal of 'em. ideally short descripive names work well. so did this: create table entitytype ( entitytypeid char(2) primary key, entitytypename varchar(128) not null ) and put data table: insert entitytype values ('a', 'type1') insert entitytype values ('b', 'type2') but can query baffles me: declare @pentitytype char(1) set @pentitytype = 'a' select ''''+entitytypeid+'''', entitytypename entitytype entitytypeid = @pentitytype the result yields 'a ', , there's whitespace in literal. my understanding there's implicit conversion that's converting char(1) -> char(2) i'm not complaining, what's rationale behind this? the reason behaviour trailing spaces ignored in string comparisons in sql server. happens irrespective of whether fixed or variable length data types being...

c - Typedef of structs -

i using structs in project in way: typedef struct { int str1_val1; int str1_val2; } struct1; and typedef struct { int str2_val1; int str2_val2; struct1* str2_val3; } struct2; is possible hack definition in way, use types code, like struct2* a; = (struct2*) malloc(sizeof(struct2)); without using keyword struct ? yes, follows: struct _struct1 { ... }; typedef struct _struct1 struct1; struct _struct2 { ... }; typedef struct _struct2 struct2; ... struct2 *a; = (struct2*)malloc(sizeof(struct2));

c# - A connection between a PDDM and the agent was closed. [TaskManager.cpp:168] -

i trying find solution issue,,that 1 service repeatadly going on restart making issue.when checked event log can see 1 waring before restart occurs warning " the description event id ( 1 ) in source ( zenworks patch management agent ) cannot found. local computer may not have necessary registry information or message dll files display messages remote computer. may able use /auxsource= flag retrieve description; see , support details. following information part of event: connection between pddm , agent closed. [taskmanager.cpp:168]." we know pddm.exe process runs in background on agent machine. handles deployments notification. agent log message when pddm.exe exits memory. following events cause pddm.exe exit memory: user logging off, computer shutting down, pddm.exe gets killed task manager.. but dont know how proceed issue,can 1 me regarding this i have 2 options 1 reinstall application,other reboot os any other options?

Hadoop 0.20.2 Eclipse plugin not fully functioning - can't 'Run on Hadoop' -

i've finished installing hadoop 0.20.2 under cygwin on windows 7 eclipse helios (3.6). hadoop started, , i'm trying run test application within newly created mapreduce test project in eclipse. i'm using hadoop 0.20.2 plugin hadoop download. the map/reduce location perspective operates correctly, dfs locations tree in package explorer. however, when right-click driver, select 'run as' > 'run on hadoop', nothing happens , no errors spawn on console (silent fail :(). believe dialog window should appear asking config before runs, not happening. there seems few others same problem, i've yet find answer works. i've tried 0.20.1 plugin (total fail). following bug report seems describe issue, though i'm bit of newbie this, hand / voice of experience out: https://issues.apache.org/jira/browse/mapreduce-1280 the hadoop eclipse plugin bundled hadoop distribution compatible eclipse version 3.3. jira-ticket mapreduce-1280 contains patch ...

user interface - Implementing a tabbed Windows dialog window in C -

background: i’ve inherited project, 10k loc implementing odbc driver. configure driver configuration window opened. configuration window defined .rc file (a resource script) defines buttons , checkboxes using x,y coordinates. up until when adding new feature copy/pasted button/checkbox changing variable names , id codes, worked pretty well. of late panel has gotten monolithic, , has been decided configuration panel should overhauled. new design segregate options tabs, instead of having them on 1 page. problem: need figure out how implement windows dialog window tabs. have googled around, tried find examples, , had no luck trying figure out. can open .rc file in visual studio (the project not developed in visual studio) , shows me nice visual representation of config panel, can drag elements around, , modifies .rc file nicely. can’t figure out how tabs work. can create tab control, can’t it. can’t figure out how put other objects on different tabs of tab control. what ideall...

internet explorer - JQuery Text Resizing not working with IE -

i using following script (that requires cookies plugin jquery) allow javascript enabled users change font size on medical charity website: var sitefunctions = { textresize: function () { var $cookie_name = "textsize"; var originalfontsize = $("html").css("font-size"); // if exists load saved value, otherwise store if ($.cookie($cookie_name)) { var $getsize = $.cookie($cookie_name); $("html").css({ fontsize: $getsize + ($getsize.indexof("px") != -1 ? "" : "px") }); // ie fix double "pxpx" error } else { $.cookie($cookie_name, originalfontsize); } // reset link $(".reset").bind("click", function () { $("html").css({ "font-size": originalfontsize }); $.cookie($cookie_name, originalfontsize); }); // text "+...

c - GCC Inline Assembly Multiplication -

i'm trying learn gcc inline assembly on linux (x86), , first experiment try , implement integer overflow detection multiplication. seems easy enough, having side effects don't understand. so, here want multiply 2 unsigned 8-bit integers, , see if result overflows. load first operand al register , other operand bl register, , use mul instruction. result stored 16-bit value in ax register. copy value in ax register c variable b , unless overflows. if overflows set c 1. uint8_t = 10; uint8_t b = 25; uint8_t c = 0; // carry flag __asm__ ( "clc;" // clear carry flag "movb %3, %%al;" // load b %al "movb %2, %%bl;" // load %bl "mul %%bl;" // multiply * b (result stored in %ax) "movw %%ax, %0;" // load result b "jnc out;" // jump 'out' if carry flag not set "movb $1, %1;" // set 'c' 1 indicate o...

asp.net - REST uri for POST and return(GET) -

sorry strange title. here situation. i have table of products name , display order of each product. client can change display order of products. table generated using jquery.tmpl , data pulled using under wcf. products pulled db categoryid. when user changes display order of product in grid product needs updated using post. once data has been updated server needs send updated json object update table. question: how structure post uri scenario? here have now. [operationcontract] [webinvoke( method = "post", requestformat = webmessageformat.json, responseformat = webmessageformat.json, bodystyle = webmessagebodystyle.bare, uritemplate = "product/form/{categoryid}")] [return: messageparameter(name = "products")] list<product> updateproduct(string categoryid); i believe uri updating resource correct updating single product category id. however, want...

Ruby: How to group a Ruby array? -

i have ruby array > list = request.find_all_by_artist("metallica").map(&:song) => ["nothing else matters", "enter sandman", "enter sandman", "master of puppets", "master of puppets", "master of puppets"] and want list counts this: {"nothing else matters" => 1, "enter sandman" => 2, "master of puppets" => 3} so ideally want hash give me count , notice how have enter sandman , enter sandman need case insensitive. pretty sure can loop through there cleaner way? list.group_by(&:capitalize).map {|k,v| [k, v.length]} #=> [["master of puppets", 3], ["enter sandman", 2], ["nothing else matters", 1]] the group creates hash capitalize d version of album name array containing strings in list match (e.g. "enter sandman" => ["enter sandman", "enter sandman"] ). map replaces each array...

matlab - How does Simulink simulation engine work? -

i understand how simulink simulation engine works. use discrete event simulation mecanism (then how continous time handled ?) ? rely on static cycle-based code generation ? or ? before first cycle, figures out order of execution of blocks (starting ones don't require inputs other blocks) each cycle, calculates output of each block based on inputs , block's code. each block's code static, existed before put model together. (i don't know if block options change code, or if evaluated @ runtime, @ each iteration.) if simulation step variable, each cycle calculates size of next step, based on how fast model's variables changing. faster change, smaller step size should be, briefly high derivative isn't assumed last longer should. (i don't know details of calculation, perhaps else can shed light?) so, "continuous" simulation, or variable-step, means simulink make educated guess each cycle step size small enough keep time quantization erro...

c# - MVC 2 Form Values not posting -

hey attempting learn mvc 2 , asp etc through mvc music store. @ same time attempting conform doing solution developing @ work. overall structure desk ticket system , working on broad admin functions of creating, editing, , deleting tickets. have followed tutorial closely have hit brick wall, when attempting use values should getting posted controller methods, , theyre not getting there. for create section create.aspx looks like <h2>create</h2> <% html.enableclientvalidation(); %> <% using (html.beginform()) {%> <%: html.validationsummary(true) %> <fieldset> <legend>create new request</legend> <%: html.editorfor(model => model.request, new {softwares = model.softwarename, systems = model.systemidno}) %> <p> <input type="submit" value="create" /> </p> </fieldset> <% } %> <div> <%: h...

html - XHTML empty tags not treated as empty tags by any browser -

Image
so i've tried xhtml 1.1 code (validated @ validator.w3.org) in chrome 6, ie 8, , firefox 3.5. <p> following <a/> gets hyperlinked, , <p> following <div/> turns red: <!doctype html public "-//w3c//dtd xhtml 1.1//en" "http://www.w3.org/tr/xhtml11/dtd/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>test</title> </head> <body> <p><a href="http://www.yahoo.com"/></p> <p> should not hyperlinked </p> <div style="background:red"/> <p>this should not red</p> </body> </html> this bad news trying deal documents using xml parsers/generators. i might able convert </> tags <></> , mean things <br/> become <br></br> -- weird, albeit valid. thoughts? if ...

What is the C++/CLI equivalent to a VB6 Collection? -

i tried arraylist^ , vb6 gives me 'type mismatch' error. don't see c++/cli 'collection' or 'list'. so equivalent, if there one? yeah, doesn't work, vb6 wants own collection class. i'm shocked how turned out. thought, easy peasy, add reference c:\windows\system32\msvbvm60.dll , use interop library generates. then: vba::collection^ coll = gcnew vba::collection(); kaboom: retrieving com class factory component clsid {a4c4671c-499f-101b-bb78-00aa00383cbb} failed due following error: 80040154. class not registered. looked in registry, it's there under hklm\clsid inprocserver32 key blank. blank . that's not good. changed point point msvbvm60.dll. kaboom, 0x80040111, "classfactory cannot supply requested class". this isn't going fly. abandon hope way see it, unless can refactor vb6 code.

c# - Regex to replace invalid characters -

i don't have experience regex using many chained string.replace() calls remove unwanted characters -- there regex can write streamline this? string messytext = gettext(); string cleantext = messytext.trim() .toupper() .replace(",", "") .replace(":", "") .replace(".", "") .replace(";", "") .replace("/", "") .replace("\\", "") .replace("\n", "") .replace("\t", "") .replace("\r", "") .replace(environment.newline, "") .replace(" ", ""); thanks try regex: regex regex = new regex(@"[\s,:.;/\\]+"); string cleantext = regex.replace(messytext, "").toupper(); \s character class equivalent [ \t\r\n] . if want preserve alphanumeric char...

multithreading - VB.NET Trying to modify a generic Invoke method to a generic BeginInvoke method, having unexpected problems -

vb.net 2010, .net 4 hello, i have been using pretty slick generic invoke method ui updating background threads. forget copied (converted vb.net c#), here is: public sub invokecontrol(of t control)(byval control t, byval action action(of t)) if control.invokerequired try control.invoke(new action(of t, action(of t))(addressof invokecontrol), new object() {control, action}) catch ex exception end try else action(control) end if end sub now, want modify make function returns nothing if no invoke required (or exception thrown) or iasyncresult returned begininvoke if invoke required. here's have: public function invokecontrol(of t control)(byval control t, byval action action(of t)) iasyncresult if control.invokerequired try return control.begininvoke(new action(of t, action(of t))(addressof invokecontrol), new object() {control, action}) catch ex exception return nothing ...

c++ - How to check if std::map contains a key without doing insert? -

the way have found check duplicates inserting , checking std::pair.second false , problem still inserts if key unused, whereas want map.contains(key); function. use my_map.count( key ) ; can return 0 or 1, boolean result want. alternately my_map.find( key ) != my_map.end() works too.

iphone - NSNotification issue: it's posted but just cached by one instance of the same class, why? -

here again: what want is: if press button, post notification. notification should cached 2 instances of same class. the problem: notification posted, cached 1 instance. some code , explanation have 1 tab bar controller have 3 tabs ( 3 different views -xib files-) 2 views references same (view controller) class (so, there 2 instances of same class, let's class a) other tab/view references class (class b) if press button of 1 view, method of class b fired and, @ point this: [[nsnotificationcenter defaultcenter] postnotificationname:@"update" object:nil ]; in viewdidload method of class have this: [[nsnotificationcenter defaultcenter] addobserver:self selector:@selector(updateall:) name:@"update" object:nil]; also, have defined updateall function as: - (void) updateall: (nsnotification *) notification { nslog(@"called"); } as said before, 1 time updateall method fired. questions why? how fix it? thanks reading!...

c++ - Optimizing 1D Convolution -

is there way speed 1d convolution ? tried make dy cache efficient compiling g++ , -o3 gave worse performances. i convolving [-1. , 0., 1] in both directions. not homework. #include<iostream> #include<cstdlib> #include<sys/time.h> void print_matrix( int height, int width, float *matrix){ (int j=0; j < height; j++){ (int i=0; < width; i++){ std::cout << matrix[j * width + i] << ","; } std::cout << std::endl; } } void fill_matrix( int height, int width, float *matrix){ (int j=0; j < height; j++){ (int i=0; < width; i++){ matrix[j * width + i] = ((float)rand() / (float)rand_max) ; } } } #define restrict __restrict__ void dx_matrix( int height, int width, float * restrict in_matrix, float * restrict out_matrix, float *min, float *max){ //init min,max *min = *max = -1.f * in_matrix[0] + in_matrix[1]; (int j=0; j < height; j++){ float* row = in_matri...

java - Storing data on ListView item -

first of i'm new android. might simple question couldn't find answer myself. i have 2 activity, i'm filling first 1 user names , other data receive remote request , second 1 being used display details of selected user. so in way need associate user records listview items, can pass of these information the second activity using intent. i'm not sure if it's right or wrong found need create custom arrayadapter. i've created user class: class user { public string id; public string name; } and guess need write like: class useradapter extends arrayadapter<user> { ... } basically in first view want display: john doe mike brown ... second 1 make request based on user.id , display information user like: john doe, 45, san francisco i couldn't find similar example i'm not sure how can that. reference helpful. thanks. in "getview" method of useradapter, set tag of view useful... view.settag(id); then ca...

caching - Cache css/js from PHP processor -

i've built php processor process css , js files. the .htaccess rewrites css , js files point processor. the processor gets contents of css/js file, processes , outputs browser. for reason css , js files refuse cache? i've set "expires" , "cache-control" headers, still no luck. any suggestions? thanks edit here's of code: function setexpires($expires) { header('expires: '.gmdate('d, d m y h:i:s', time()+$expires).' gmt'); header("cache-control: max-age=$expires, public"); header("connection: close"); } i'm using google chrome dev tools. headers coming this: request url:http://www.static.do-u-know.net/css/common.1286502074.css request method:get status code:200 ok request headers accept:text/css,*/*;q=0.1 cache-control:max-age=0 referer:http://www.do-u-know.net/frame.php user-agent:mozilla/5.0 (windows; u; windows nt 6.1; en-us) applewebkit/534.3 (khtml, gecko) chrome/6.0.472.6...

c# - Is there a way to underline one character in a WPF TextBlock? -

is there way apply underline text decoration 1 character in textblock (or amount less full block)? i have text want output "this worf misspelt" , have f in worf underlined. i know can do: textblock47.textdecorations = textdecorations.underline; but don't want entire block underlined. failing that, there control can use other textblock gives capability? i've looked rich text seems awful lot of work what's simple effect. if is way, how go generating text of specific format (10pt, courier new, 1 character underlined) in c# code? you can use underline in textblock : <textblock name="textblock47"> wor<underline>f</underline> misspelt </textblock> or textblock47.inlines.add(new run("this wor")); textblock47.inlines.add(new underline(new run("f"))); textblock47.inlines.add(new run(" misspelt"));

registerclientscriptblock - Asp.net: How to call a javascript function at the end of button click code behind -

my motto call java script function @ end of button click code behind. ie, firstly need execute server side function after java script function should invoked. my server side method follows protected string saveembedurl_click() { if (txtembedurl.text != null) { school aschool = new school(); aschool.schoolid = currentschool.schoolid; aschool.embedurl = txtembedurl.text; schoolrespository.updateembedurl(aschool); return "true"; } } my java script function follows function saveembedurlclientside() { admin_customizetheme.saveembedurl_click(true); $('#lbl_embedcode').removeclass('hide').addclass('show'); $('#embedcode').removeclass('hide').addclass('show'); copytoclipboard("embedcode"); } how can achieve this? thanks. i'm pretty sure need add this registerstartupscript("yourjavascript", "saveembedurlclientside()...

.net - MakeSfxCA.exe and DLL compiled with Framework 4.0 -

i have dll file compiled microsoft .net framework 4.0 when using makesfxca.exe file , passing dll 1 of parameter command line gives me following error message: d:\setupmanager\test>d:\setupmanager\setupbuilding\wix\bin\sdk\makesfxca.exe fil e2.dll d:\setupmanager\setupbuilding\wix\bin\sdk\x86\sfxca.dll file1.dll customa ction.config searching custom action entry points in file1.dll error: system.badimageformatexception: not load file or assembly 'file:/// d:\setupmanager\test\file1.dll' or 1 of dependencies. **this assembly bui lt runtime newer loaded runtime , cannot loaded.** file name: 'file:///d:\setupmanager\test\file1.dll' @ system.reflection.assembly._nload(assemblyname filename, string codebase, evidence assemblysecurity, assembly locationhint, stackcrawlmark& stackmark, boo lean throwonfilenotfound, boolean forintrospection) @ system.reflection.assembly.nload(assemblyname filename, string codebase, e vidence assemblysecurity, assembly loca...

php - Theme function in Drupal 6 -

im using drupal 6.x. in page have following code prints paged table. $headers = array(array('data' => t('node id'),'field' => 'nid','sort'=>'asc' ), array('data' => t('title'),'field' => 'title'), ); print theme('pager_table','select nid,title {node_revisions}', 5, $headers ); is there way can pass rows of table array theme function ? i don't know theme_pager_table , it's not part of drupal core. can do, wrap sql in pager_query() , can loop through results , create table rows normal. pager_query() handle adding limit , offset in query. doing cam use normal theme_table , add pager theme_pager . (remember use theme , wrapper function instead of calling theme functions directly)

Google App Engine Python: sys.path.append not working online -

i have import sys sys.path.append('extra_dir') import extra_module it work under windows xp app engine sdk (offline) but when deploy online, give me <type 'exceptions.importerror'> , missing deploy online? try this: sys.path.append(os.path.join(os.path.dirname(__file__), 'extra_dir'))

qr code - qrcode generator using python for windows -

i looking qrcode generator python window version. can me find out. i didn't anywhere. please me. thanks, manu either have compile yourself; or if need generate codes (i.e. encoding no decoding), use pyqrencode can pypi (e.g. pip install pyqrencode ) if don't have pip , suggest start installing setuptools , use easy_install install pip (of course, can cut corners doing easy_install pyqrencode

Merge branch to the head in CVS problem -

i understand cvs obsolete system in out time company use it. problem next. usual when developing starts create branch head , start work. times later re-base branch head , merge head branch. ok. every next typically operations problem. many-many files marked changed, in fact files hasn't changes! . , these files aren't become white red . it's problem, because need review of sure file modified. re-base branch head have ( using wincvs ): 1.click update.. on branch; 2.check create missing directories ; 3.check get clean copy ; 4.check update using last check in time ; 5.select revision update ; 6.select merge type . any ideas why can happen? thanks. tag head after each rebase, , next time rebase, set root tag last tag made. like this: create branch head, tag head branch_root_1 do work in head merge head branch root branch branch_root_1, tag head branch_root_2 do more work in head merge head branch root branch branch_root_2, tag head branch_...