Posts

Showing posts from April, 2012

.net - When creating a new GUI, is WPF the preferred choice over Windows Forms? -

most restrictions , tricks windows forms common programmers. since .net 3.0 there wpf available, windows presentation foundation. said can make "sexy applications" more easy , .net 3.5 sp1 got speed boost on execution. but on other side lot of things working different wpf. not more difficult have learn "everything" scratch. my question: worth spend time when have create new gui , there no time pressure project? wpf enables amazing things, , love it... feel obligated qualify recommendations, whenever developers ask me whether think should moving new technology. are developers willing (preferrably, eager) spend time takes learn use wpf effectively? never have thought mfc, or windows forms, or unmanaged directx, not want team trying "pick up" wpf on course of normal dev. cycle shipping product! do @ least 1 or 2 of developers have design sensibilities, , individuals final design authority have decent understanding of development issues, ...

git svn - git-svn vcs switch: where are my branches? -

i converted large svn repository git repository with git svn init svn/server/project --no-metadata git svn fetch this took better part of 2 days finish. this repo should have quite few branches when "git branch" nothing master. listed under branches directory, shouldn't see them "git branch" well? "git branch -a" shows master , remotes/git-svn. was --no-metadata switch did this? when initializing git repository need use either --trunk , --branches , --tags options or --stdlayout option git svn init in order tell path directories trunk , branches , tags directories in subversion repository. see manual page git-svn additional details.

java - When can/should you go whole hog with the ORM approach? -

it seems me introducing orm tool supposed make architecture cleaner, efficiency i've found myself bypassing , iterating on jdbc result set on occasion. leads uncoordinated tangle of artifacts instead of cleaner architecture. is because i'm applying tool in invalid context, or deeper that? when can/should go whole hog orm approach? any insight appreciated. a little of background: in environment have 50 client computers , 1 reasonably powerful sql server. i have desktop application in 50 clients accessing data @ times. the project's data model has gone through number of reorganizations various reasons including clarity, efficiency, etc. my data model's history jdbc calls directly dao + pojo without relations between pojos (basically wrapping jdbc). added relations between pojos implementing lazy loading, hiding inter-dao calls jumped onto hibernate bandwagon after seeing how "simple" made data access (it made inter pojo relations tr...

.net - Showing a tooltip for a MenuItem -

i've got menu contains, among other things, most-recently-used file paths. paths these files can long, text gets clipped "c:\progra...\foo.txt" i'd pop tooltip full path when user hovers on item, doesn't seem possible tooltip class in .net 2.0. am missing obvious? if creating menu items using system.windows.forms.menuitem class won't have "tooltiptext" property. you should use system.windows.forms.toolstripmenuitem class new of .net framework 2.0 , include "tooltiptext" property. you have remember specify showitemtooltips = true on menustrip control

How can I use unit testing framework on sharepoint 2007? -

i have moss2007 application , want unit test on application. there way that? use typemock isolator sharepoint

How to permanently remove a breakpoint in Visual Studio 2005 /2008 (ASP.NET, C#) -

often, when have breakpoint on line in visual studio, program run , stop there. great. click red circle (or press f9) remove it. don't want program keep stopping there. problem next time refresh page breakpoint back! way permanently remove open breakpoints window , remove there. why happen , how can change behavior? i have noticed these breakpoints keep coming have little plus next them in breakpoints window when click on - open many sub lines of breakpoints. deal that? thanks, adin helpful key combo: permanently delete breakpoints, press ctrl + shift + f9.

What is Adobe Flex? Is it just Flash II? -

question alright, i'm confused buzzwords , press release bingo going on. what relationship between flash , flex: replace flash (not compatible) enhance flash the next version of flash still compatible separate technology altogether ??? if i'm starting out in flash now, should skip flex? follow up ok, i'm hearing there's 3 different parts puzzle: flash the graphical editor used make "flash movies", ie it's ide focuses on visual aspect of "flash" (officially flash cs3?) the official name display plugins (ie, "download flash now!") a general reference entire technology stack in terms of editor, it's linear timeline based editor, best used animations complex interactivity. actionscript the "flash" programming language flex an adobe flash ide focuses on coding/programming aspect of "flash" (flex builder?) a flash library enhances flash , makes easier program (flex sdk?) is ...

java - How to get a .jar to recognise and use a bundled log4j.xml file? -

i'm building project ant , during build i'd bundle log4j.xml file directly .jar make distribution simpler. i've been successful in adding file .jar , doesn't seem recognised. what need ensure file recognised , used log4j ? i'm new java, clear description, examples if possible, great! this somehow works. static // loads before else can { /* * if log4j.configuration system property isn't set, * assume i'm inside jar , configure * log4j using config file shipped in jar. */ if (system.getproperty("log4j.configuration") == null) { url url = classloader.getsystemresource("log4j.xml"); domconfigurator.configure(url); } }

Creating a mini-site in ASP.NET that works on Blackberry, Windows Mobile, and iPhone -

i'm working on asp.net website targets desktop browsers. want enable optional mobile view (e.g. http://m.sample.com ) offer few simple pages text. there not need ajax or javascript, , there's no user input - it's tables of text few links navigate between pages. what's best way set work on blackberry, windows mobile, , iphone? should looking @ asp.net mobile support, or rolling own pages? update : m.microsoftpdc.com. went /mobile subfolder approach, , used scott hanselman's iphone tips viewport , other stuff . i have done in past , way did separating pages creating directory desktop , creating directory mobile. gives better separation of views, since in reality lot different. in asp.net forms used model view presenter pattern lot since went way asp.net forms functioned best. way reuse code between 2 views. in index.aspx page site, parse user-agent string of request figure out browser , redirect accordingly. so, example person iphone comes si...

multilingual - Is it feasible to support multiple applications of the same type that are all written in different languages? -

as benefit programmers language agnostic, feasible support multiple enterprise web applications of same type written in different languages? think how complicated cms or e-commerce system can -- imagine supporting 3 different cms platforms written in different languages. hate known .net or java or php shop, don't want vendor says can support solution have never worked with, upsetting client wonders why can't done right on time. can speak experience on this? company suck up, , try , learn new platform on fly? bill up-to-speed, or eat costs? i think depends on clients , expect. think knowing different technologies good, when you're hired someone, expect know doing. personally, rather known job type of technology , when hired, job done well. if try , go after every contract without regard core competencies are, aren't going succeed. you'll anger people hire , make mistakes, , you'll potentially miss opportunities can shine. have make compromises...

Check if ostream object is cout or ofstream, c++ -

is there way in c++ check if ostream object cout or ofstream object? something like: ostream& output(ostream& out) { if (out == cout) return out; else { out << "something different because not going console" << endl; return out; } } the reason want this, want overload << operator 2 different things depending on type of stream used with. is possible overload << operator twice each time different type of stream? updated reflect intention better. it's possible checking stream's 'identity': if ( &out == &cout ) ... . however, i'm in doubt on usefullness of test. if function can handle output stream, why bother stream using?

sql server - Troubleshooting Missing Rows with MS Sync Framework -

i'm using microsoft sync framework version 2 synchronize data between server database running sql server 2008 , sqlce 3.5 database on connected wpf app. this working fine part, rows particular table don't seem getting pushed server database when inserted on client. rows other tables make there fine. i've tried few things far: i've made sure i'm setting syncdirection table bidirectional i've refreshed synctable definition removing , re-adding table though "configure database synchronization" wizard. ensured rows inserted sqlce database conform not null , foreign key constraints in server database. confirmed change tracking enabled on table on server. what else should check cause data not synced server particular table?

ruby on rails - How to create multiple records at once with ActiveScaffold in ROR -

i wanting use activescaffold create assignment records several students in single step. records contain identical data, exception of student_id. i able override default form , replace dropdown box selecting student name multi-select box - want. change however, cosmetic, underlying code grabs first selected name box, , creates single record. can suggest way accomplish in way doesn't require deciphering , rewriting of underlying activescaffold code? update: still haven't found answer problem. i suppose have defined multi-select box adding :multiple => true html parameters of select_tag. then, in controller, need access list of names selected, can this: params[:students].collect{|student| insert_student(student, params[:assignment_id]) } with collect applied array or enum can loop through each item of array, , need each student (in example, call function insert students). collect returns array results of doing code inside.

c# - Getting all possible combinations from a list of numbers -

i'm looking efficient way achieve this: you have list of numbers 1.....n (typically: 1..5 or 1..7 or - reasonably small, can vary case case) you need combinations of lengths numbers, e.g. combinations of 1 number ({1}, {2}, .... {n}), combinations of 2 distinct numbers ({1,2}, {1,3}, {1,4} ..... {n-1, n} ), combinations fo 3 of numbers ({1,2,3}, {1,2,4}) , forth basically, within group, order irrelevant, {1,2,3} equivalent {1,3,2} - it's matter of getting groups of x numbers list seems there ought simple algorithm - have searched in vain far. combinatorics , permutation algorithms seems a) take order account (e.g. 123 not equal 132), , seems operate on single string of characters or numbers.... anyone have great, nice'n'quick algorithm sleeve?? thanks! just increment binary number , take elements corresponding bits set. for instance, 00101101 mean take elements @ indexes 0, 2, 3, , 5. since list 1..n, element index + 1. this generate in-or...

iphone - Modifying code to add a home button -

currently code need modify uses tabbarcontroller single selection inside takes user root view, because tabbar whole of tab selectable , need button positioned in middle of tab bar selected. i new know not tabbar needed here else, maybe place button there. fantastic. post code unsure section required. hope made myself clear enough :) rowley tab bars switching among different views. if want home button, tab bar not choice. use either simple uibutton, or possibly tool bar -- though tool bar used when there more 1 action user might take.

How to animate the command line? -

i have wondered how people update previous line in command line. great example of when using wget command in linux. creates ascii loading bar of sorts looks this: [======>                    ] 37% and of course loading bar moves , percent changes, doesn't make new line. cannot figure out how this. can point me in right direction? there 2 ways know of this: use backspace escape character ('\b') erase line use curses package, if programming language of choice has bindings it. and google revealed ansi escape codes , appear way. reference, here function in c++ this: void drawprogressbar(int len, double percent) { cout << "\x1b[2k"; // erase entire current line. cout << "\x1b[0e"; // move beginning of current line. string progress; (int = 0; < len; ++i) { if (i < static_cast<int>(len * percent)) { progress += "="; } e...

sql - ADODB connection to ACCDB file -- unrecognized database format error -

i have file this: strpath = "s:\hr\forms\forms_database.accdb" i connecting through word adodb.connection should database different extension ? mdb or something? i getting error when tries connect: unrecognized database format 's:...............accdb' what's going on here? here's entire code: sub transfershipper() 'transfer new shipping company record 'shippers table in northwind database. dim cnn adodb.connection dim strconnection string dim strsql string dim strpath string dim doc word.document dim strcompanyname string dim strphone string dim bytcontinue byte dim lngsuccess long set doc = thisdocument on error goto errhandler strcompanyname = chr(39) & doc.formfields("txtcompanyname").result & chr(39) strphone = chr(39) & doc.formfields("txtphone").result & chr(39) 'confirm new record. bytcontinue = msgbox("do want insert record?", vbyesno, ...

Learn Silverlight or WPF first? -

it seems silverlight/wpf long term future user interface development .net. great because can see advantage of reusing xaml skills on both client , web development sides. looking @ wpf/xaml/silverlight seem large technologies , best place start? i hear has knowledge of both , can recommend better starting point , why. should learn asp.net or winforms first? asp or mfc? html or vb? c# or vb? set aside idea there logical progression through has become highly complex interwoven set of technologies, , take step , ask series of questions: what goals; how want balance profit against enjoyment are short term oriented or in long haul are type of person likes @ , lot or bored once understand it? the next , hardest step come accept advice given bound wrong; , longer time horizon more incorrect. if advice more 6 12 months, probability advice wildly incorrect approaches 1. i can tell story, quickly. in 2000 happy consultant working profitably in c++ on windows applicati...

accessibility - Enhancing the web user experience for the vision impaired -

i listening recent episode of hanselminutes scott hanselman discussing accessibility in web applications , got me thinking accessibility in own applications. we understand importance of semantic markup in our web applications relates accessibility other simple enhancements can made improve user experience disabled users? in episode, there number of times slapped forehead , said "of course! why haven't done that?" in particular, scott talked website placed hidden link @ top of web page said "skip main content". link visible people using screen readers , allows screen reader jump past menus , other secondary content. it's such obvious improvement yet it's easy not think of it. there more accessibility , overall user experience creating valid xhtml , calling day. what of simple tricks improving user experience vision impaired? creating accessible pages hard think if have never done it. however, once learn basic concepts easy in 95% ...

c++ - Combination of types using boost::mpl -

i have list of types, want construct list of combinations 2 elements. example: namespace mpl = boost::mpl; typedef mpl::vector<int, long> typelist; // mpl magic... // wanted list equivalent to: typedef mpl::vector<pair<int, int>, pair<int, long>, pair<long, int>, pair<long, long> > combinations; here, pair<t1,t2> std::pair<t1,t2> , or mpl::vector<t1,t2> . how this? interested in removing duplicates when consider pair<t1, t2> == pair<t2, t1> . thanks. the list of combinations of single type int list of types mpl::vector<int, long> can computed invoking mpl::fold : typedef fold< mpl::vector<int, long>, vector<>, push_back<mpl::_1, std::pair<int, mpl::_2> > >::type list_of_pairs; now, if wrap separate meta-function , invoke types of initial typelist get: typedef mpl::vector<int, long> typelist; template <typename t, typena...

c++ - Accessing Firefox cache from an XPCOM component -

does know how local path of file cached firefox based on url xpcom component? to access cached items, new cache session must created using createsession method provided in nsicacheservice . method creates nsicachesession object. information cache item can obtained using opencacheentry method of session object (method return nsicacheentrydescriptor ). read data user must open input stream using openinputstream method of cache entry object.

PHP: How to expand/contract Tinyurls -

in php, how can replicate expand/contract feature tinyurls on search.twitter.com? if want find out tinyurl going, use fsockopen connection tinyurl.com on port 80, , send http request this get /dmsfm http/1.0 host: tinyurl.com the response like http/1.0 301 moved permanently connection: close x-powered-by: php/5.2.6 location: http://en.wikipedia.org/wiki/tinyurl content-type: text/html content-length: 0 date: mon, 15 sep 2008 12:29:04 gmt server: tinyurl/1.6 example code... <?php $tinyurl="dmsfm"; $fp = fsockopen("tinyurl.com", 80, $errno, $errstr, 30); if (!$fp) { echo "$errstr ($errno)<br />\n"; } else { $out = "get /$tinyurl http/1.0\r\n"; $out .= "host: tinyurl.com\r\n"; $out .= "connection: close\r\n\r\n"; $response=""; fwrite($fp, $out); while (!feof($fp)) { $response.=fgets($fp, 128); } fclose($fp); //now parse location: header ...

c++ - binary search tree -

i have implement binary search tree in c++ #include <iostream> #include <cstdlib> using namespace std; class binary{ private: struct tree{ tree *left; tree *right; int data; }; tree *root; public: binary(){ root=null; } bool empty() { return root=null;} void print_inorder(); void inorder(tree*); void print_preorder(); void pre_order(tree*); void print_postorder(); void post_order(tree *); void insert(int); void remove(int); }; void binary::insert(int d){ tree *t=new tree; tree *parent; t->data=d; t->left=null; t->right=null; parent=null; //is new tree; if (empty()) root=t; else{ tree *current; current=root; //find nod's parent while (current){ parent=current; if (t->data>current->data) current=current->right; el...

objective c - Decoding integer and other masks in Cocoa -

cocoa has plethora of integer masks , codes. instance, nscommandkeymask or nsf1functionkey, defined , documented in headers. however, can archaic , when accessing accessibility attributes, instance glyph (axmenuitemcmdglyph), you're given integer number 111, represents f1 (0xf704), or 112 represents f2 (hex: 0xf705). is there easy way deal masks , codes? perhaps 1 that's able convert 111 corresponding hex unicode 0xf704? mean nsevent.h maps nsf1functionkey 0xf704, there mapping 111 nsf1functionkey or 0xf704? if want unicode character menu item's key equivalent, rather glyph it, try getting the kaxmenuitemcmdcharattribute attribute instead of kaxmenuitemcmdglyphattribute .

machine learning - Similarity search between time series in Matlab. Possible ? I cant find R-tree implementation in matlab -

i implement similarity search in matlab. wanna know possible ? my plan use 2 popular similarity measurement euclidean distance , dynamic time warping. both of these applied on time series dataset. question @ point how can evaluate both of these 2 measurement performance , accuracy ? seen literature saying should use k-nn algorithm. then, plan apply dimensionality reduction on time series dataset. after reducued dimensionality of dataset. need index dataset using r-tree or indexing techniques available. however problem this, need r-tree matlab code hardly able find in internet ... i realised of implementation similarity search in c++, c , java ... im not familiar those. im hoping implement these in matlab ... guru me ? also kind of evaluation can make evaluate performance each algorithm. thanks recently (r2010a believe), matlab added new functions k-nearest neighbor (knn) searching using kd-tree (a spatial indexing method similar r-tree) statistics toolbox. ...

c# - How to turn .h file +dll into some kind of .Net wrapper? -

how toturn .h file +dll kind of .net wrapper? or that? (no c\c++ sources h files) if have header file, , use many implement dll can use swig( http://www.swig.org/ ) generate wrapper automatically. compile dll , invoke interfaces or class .net code. or if use few method dll, use p/invoke.

Why would a static nested interface be used in Java? -

i have found static nested interface in our code-base. class foo { public static interface bar { /* snip */ } /* snip */ } i have never seen before. original developer out of reach. therefore have ask so: what semantics behind static interface? change, if remove static ? why this? the static keyword in above example redundant (a nested interface automatically "static") , can removed no effect on semantics; recommend removed. same goes "public" on interface methods , "public final" on interface fields - modifiers redundant , add clutter source code. either way, developer declaring interface named foo.bar. there no further association enclosing class, except code cannot access foo not able access foo.bar either. (from source code - bytecode or reflection can access foo.bar if foo package-private!) it acceptable style create nested interface way if expect used outer class, not create new top-level name. example: pu...

JQuery form validation - validate form based on other form field -

i"m using jquery form validation in basic form looks this $('#shopping_form').validate({ submithandler: function(){ $.post("/url", { message: messageval}, function(data) { ...... ...... }, } ,rules: { message: { required:true }, price: { number: true } } }); now adding 2 radio buttons form call them radio1 , radio2. if radio1 selected field message required , radio2 not required field. how can add kind of rule. in advance you can writing custom method checks radio button value , depending on value , checks message field. here code can add in jquery $.validation.addrule("message",{ check: function(value) { // check value of radio button here, can if($("form input:radio:checked").val() == 'radio2') return true; // radio2 checked return valid, ie. field not required field. if(value.length > 0) { return true; } return false; }, msg : ...

Recompiling a VB.NET application -

so have vb.net application. uses sql server database, "hard-codes" ip address of database inside compiled code. the server ip has changed , can't start software anymore. also, can't change ip address of server (another server using same ip , can't changed). it 2 exe files no external dlls or else. opened both of them in hex editor, tried search ascii of ip address, couldn't find it, tried hex search no result. then used .net reflector ( http://www.red-gate.com/products/reflector/ ), , exported code. see ip address located: in form2 string variable named "strmyconnectionstring". however, recompiling files exported reflector didn't work me: got 100 error , alot of warnings; obviously, forms missing codes decompiled. has 100 forms, , hard redesign them (if considered solution - not sure). how suggest solving this? need change ip can't use software anymore! thanks! if have .net exe don't have source code for, you're...

kohana - Ko3 - Jelly Module - 500 Internal Error -

this driving me crazy. reason, jelly module throws 500 internal error. have no idea why it, or how solve this. when remove jelly module folder server or rename of jelly module files, error disappears (kohana throws error because jelly class not found normal). i don't understand why jelly throw internal error, not make sense! (the error not come folders , files permissions. made sure they're 755 , 644). (everything works fine locally - wamp server) thank you. check you're on latest version of jelly. check files syntax errors. if don't error page returned kohana it's because you've crashed php in way. sorry if doesn't help, please post more code/debug info.

mask - How to customize the Masked Input jQuery plugin -

i using jquery mask plugin from http://digitalbush.com/projects/masked-input-plugin/ i want customize plugin , have tried best can't. what want is i can enter digits only. all digits formatted automatically (,) after every 3rd number. only 2 digits after (.) i using mask: $("#product").mask("999,999,999.99",{placeholder:" "}); the problem if need type 150.50, need bring cursor on exact place , type. for example in above mask if type 150.50 text box looks this: [][][],[][][],150.50 [] blank space. want 150.50 shown, without (,)s. if type 1150.50 show 1,150.50, want formatting automatically occur once done typing , don't want show (,)s. you not want masking plugin, formatting plugin .. have @ http://plugins.jquery.com/project/number_format

exception - Causes of getting a java.lang.VerifyError -

i'm investigating following java.lang.verifyerror java.lang.verifyerror: (class: be/post/ehr/wfm/application/serviceorganization/report/displayreportservlet, method: getmonthdata signature: (iiljava/util/collection;ljava/util/collection;ljava/util/hashmap;ljava/util/collection;ljava/util/locale;lorg/apache/struts/util/messagere˜Ì´mtÃŒ´mÚw€mçw€mp:”mŒŒ @ java.lang.class.getdeclaredconstructors0(native method) @ java.lang.class.privategetdeclaredconstructors(class.java:2357) @ java.lang.class.getconstructor0(class.java:2671) it occurs when jboss server in servlet deployed started. compiled jdk-1.5.0_11 , tried recompile jdk-1.5.0_15 without succes. compilation runs fine when deployed, java.lang.verifyerror occurs. when changed method name , got following error: java.lang.verifyerror: (class: be/post/ehr/wfm/application/serviceorganization/report/displayreportservlet, method: getmd signature: (iiljava/util/collection;lj...

c++ - How to set breakpoints on future shared libraries with a command flag -

i'm trying automate gdb session using --command flag. i'm trying set breakpoint on function in shared library (the unix equivalent of dll) . cmds.gdb looks this: set args /home/shlomi/conf/bugs/kde/font-break.txt b ia__fcfontmatch r however, i'm getting following: shlomi:~/progs/bugs-external/kde/font-breaking$ gdb --command=cmds.gdb... gnu gdb 6.8-2mdv2009.0 (mandriva linux release 2009.0) copyright (c) 2008 free software foundation, inc. license gplv3+: gnu gpl version 3 or later free software: free change , redistribute it. there no warranty, extent permitted law. type "show copying" , "show warranty" details. gdb configured "i586-mandriva-linux-gnu"... (no debugging symbols found) function "ia__fcfontmatch" not defined. make breakpoint pending on future shared library load? (y or [n]) [answered n; input not terminal] so doesn't set breakpoint after all. how can make default answer "y" set breakpoints...

Is there MGET analog for Redis hashes? -

i'm planning start using hashes insead of regular keys. can't find information multi hash-keys in redis wiki. kind of command supported redis? thank you. you can query hashes or keys in pipeline, i.e. in 1 request redis instance. actual implementation depends on client, redis-py it'd this: pipe = conn.pipeline() pipe.hgetall('foo') pipe.hgetall('bar') pipe.hgetall('zar') hash1, hash2, hash3 = pipe.execute() client issue 1 request 3 commands. same technique used add multiple values set @ once. read more @ http://redis.io/topics/pipelining

performance - Where should you enable SSL? -

my last couple of projects have involved websites sell product/service , require 'checkout' process in users put in credit card information , such. got ssl certificates security of plus giving peace of mind customers. am, however, little clueless subtleties of it, , importantly parts of website should 'use' certificate. for example, i've been websites moment hit homepage put in https - banking sites - , there websites put in https when checking out. overkill make entire website run through https if doesn't deal on level of banking? should make checkout page https? performance hit on going out? i go "ssl go woe". if user never enters credit card number, sure, no ssl. but there's inherent possible security leak cookie replay. user visits site , gets assigned cookie. user browses site , adds data cart ( using cookie ) user proceeds payment page using cookie. right here there problem, if have handle payment negotiation yourse...

php - From where do i pass id to delete a record? -

how pass id delete record in code? <form action="index.php"> <?php mysql_connect('localhost', 'root', ''); mysql_select_db('user'); $query = mysql_query("select * tbluser"); echo "<center>"; echo '<table style="border:solid 2px black;">'; while(($row = mysql_fetch_array($query)) != null) { echo '<tr>'; echo '<td>' . $row['username'] . '</td>'; echo '<td>' . $row['password'] . '</td>'; echo '<td>' . $row['emailaddress'] . '</td>'; echo '<td>' . $row['address'] . '</td>'; echo '<td>' . $row['address'] . '</td>'...

networking - Can WampServer be used successfully in production? -

can wampserver used in production? bad idea? so knows, , don't see how mattered, we've paid windows dedicated box , have existing iis apps. wanted use php based cms installs easier on apache (since has dependencies). so, title indicated, windows, apache, php, , mysql requirements. additionally, i'm talking of wampserver flavor of wamp. if you're not going onto internet, there isn't reason not to. of course you'd have @ normal caveats - backups etc. instead of using made one, why not try own? learning experience , aren't hard working together.

java - How to get the real request URL in Struts with Tiles? -

when you're using tiles struts , do... request.getrequesturl() ...you url e.g. /web-inf/jsp/layout/newlayout.jsp instead of real url entered/clicked user, /context/action.do . in newer struts versions, 1.3.x , after, can use solution mentioned on javaranch , real url using request attribute original_uri_key . but how in struts 1.2.x? i use this, works on spring: <% out.println(request.getattribute("javax.servlet.forward.request_uri")); %> if need query string (contributed matchew ): <% out.println(request.getattribute("javax.servlet.forward.query_string")); %>

html5 - Why does this WebGL framebuffer usage throw FRAMEBUFFER_UNSUPPORTED? -

i'm trying create webgl pick buffer; can see i'm doing wrong here? i'm getting "incomplete framebuffer: framebuffer_unsupported" on mozilla/5.0 (x11; linux x86_64; rv:2.0b3pre) gecko/20100724 minefield/4.0b3pre , chrome 5.0.375.99. must obvious , staring right @ me cant see it. it's apparently valid, has texture..but "unsupported"? var gl = canvas.context; var framebuf = gl.createframebuffer(); var renderbuf = gl.createrenderbuffer(); var picktexture = gl.createtexture(); gl.bindtexture(gl.texture_2d, picktexture); var width = 400; var height = 400; try { gl.teximage2d(gl.texture_2d, 0, gl.rgb, width, height, 0, gl.rgb, gl.unsigned_byte, null); } catch (e) { // null rejected var tex = new webglunsignedbytearray(width * height * 3); gl.teximage2d(gl.texture_2d, 0, gl.rgb, width, height, 0, gl.rgb, gl.unsigned_byte, tex); } gl.bindframebuffer(gl.framebuffer, frameb...

multiple instances of the same jquery script -

if have script needs run multiple times on page, in cms example, how approach this? in 1 experiment had code run multiple times put article id on end of selectors fire off commands , needed manipulated. it's not workaround though cause there's duplication of code (even though works). here example got in recent stack overflow discussion (with article ids appended(textpattern)): <script type="text/javascript"> $(document).ready(function() { $('.fulltracksinner<txp:article_id />').hide(); $('.tracklist<txp:article_id />').click(function() { $('.fulltracksinner<txp:article_id />').slidetoggle('medium'); if ($('.fulltracksinner<txp:article_id />').is(':hidden')) { $(this).text('show tracklist'); } else { $(this).text('hide tracklist'); } }); }); </script> ...

How to prevent Windows Installer from running each time Access 2003 and 2007 start when there are installed on the same machine? -

is possible prevent windows installer running every time access 2003 , access 2007 started, when both installed on same machine @ same time..? like many developers need run more 1 version of ms access. have installed access 2007. if open access 2003 , open access 2007 have wait 3mins 'configuring microsoft office enterprise 2007..." dialog. if open access 2003 again takes 30secs or configure that. please note: using shortcuts open files include full path access. eg open access 2007: "c:\program files\microsoft office 12\office12\msaccess.exe" "c:\test.accdb" and 2003: "c:\program files\microsoft office 11\office11\msaccess.exe" "c:\test.mdb" this caused windows installer, used both installers. advertised shortcuts used both office 2003 , office 2007 invoke windows installer check entire feature installed properly; installer detects else (in case other product) has registered file extensions used access (po...

iPhone app codeSigning only fails for "device + release" -

i can compile , install (on iphone) several of apps i've written. i have 1 generic "*" certificate developing app. (it expires in 6 days) i have individual "com.site.appname" distributing each app. but there's 1 app, started giving: warning: application failed codesign verification. signature invalid, or not signed apple submission certificate. (-19011) i above error when try using "device + release" setting. it still can installed on phone... , seems run fine. (isn't impossible if isn't not code-signed?) when try "device + debug" or "device + distribute", there's no signing error @ all. (so know have set correctly.) i assume means have set wrong in "project info + device + release" values. (but where????) or should checking "target info + device + release" values instead? this might work, might not, fixes lot of these situations: download iphone configurat...

c++ - Why use apparently meaningless do-while and if-else statements in macros? -

in many c/c++ macros i'm seeing code of macro wrapped in seems meaningless do while loop. here examples. #define foo(x) { f(x); g(x); } while (0) #define foo(x) if (1) { f(x); g(x); } else i can't see do while doing. why not write without it? #define foo(x) f(x); g(x) the do ... while , if ... else there make semicolon after macro means same thing. let's had second macro. #define bar(x) f(x); g(x) now if use bar(x); in if ... else statement, bodies of if statement not wrapped in curly brackets, you'd bad surprise. if (corge) bar(corge); else gralt(); the above code expand into if (corge) f(corge); g(corge); else gralt(); which syntactically incorrect, else no longer associated if. doesn't wrap things in curly braces within macro, because semicolon after braces syntactically incorrect. if (corge) {f(corge); g(corge);}; else gralt(); there 2 ways of fixing problem. first use comma sequence statements within mac...

References on code generation in a compiler (intermediate representations, SSA, instruction selection, register allocation, etc.)? -

i have dragon book , modern compiler implementation in ml . i'm looking other resources on code generation in compiler. can recommend any? see this question .

python - How would I implement a bit map? -

i wish implement 2d bit map class in python. class have following requirements: allow creating of arbitrarily sized 2d bitmaps. i.e. create 8 x 8 bitmap (8 bytes), like: bitmap = bitmap(8,8) provide api access bits in 2d map boolean or integer values, i.e.: if bitmap[1, 2] or bitmap.get(0, 1) able retrieve data packed binary data. each row of bit map concatenated , returned binary data. may padded nearest byte or similar. bitmap.data() be able create new maps binary data retrieved: new_bitmap = bitmap(8, 8, bitmap.data()) i know python able perform binary operations, i'd suggestions how best use them implement class. bit-packing numpy ( scipy ) arrays looking for. example shows 4x3 bit (boolean) array packed 4 8-bit bytes. unpackbits unpacks uint8 arrays boolean output array can use in computations. >>> = np.array([[[1,0,1], ... [0,1,0]], ... [[1,1,0], ... [0,0,1]]]) >>> b = np.packbits...

xaml - Newline in string attribute -

how can add line break text when being set attribute i.e.: <textblock text="stuff on line1 \n stuff on line2" /> breaking out exploded format isn't option particular situation. need way emulate following: <textblock> <textblock.text> stuff on line1 <linebreak/> stuff on line2 </textblock.text> <textblock/> <textblock text="stuff on line1&#x0a;stuff on line 2"/> you can use hexadecimally encoded value represent literal. in case, used line feed (char 10). if want "classic" vbcrlf , can use &#x0d;&#x0a; by way, note syntax: it's ampersand, pound, letter x , hex value of character want, , semi-colon. also: completeness, can bind text has line feeds embedded in constant in code behind, or variable constructed @ runtime.

cryptography - HMAC security - Is the security of the HMAC based on SHA-1 affected by the collisions attacks on SHA-1? -

is security of hmac based on sha-1 affected collisions attacks on sha-1? the security implications of hmac described in detail in security section of the rfc . in nutshell, strong attack indeed required before security of hmac threatened; existing collision attacks on sha-1 don't constitute such. hmac designed make attacks difficult, , ordinary collision attacks won't suffice: the security of message authentication mechanism presented here depends on cryptographic properties of hash function h: resistance collision finding (limited case initial value secret , random, , output of function not explicitly available attacker), , message authentication property of compression function of h when applied single blocks (in hmac these blocks partially unknown attacker contain result of inner h computation and, in particular, cannot chosen attacker). i recommend reading whole section; goes more detail attacks would suffice break hmac,...

ms word - Documents.Add results in template being locked -

i have macro creates new document based on template stored on network share. macro stored in each user's word\startup folder file "macros.dotm" , executed button added toolbar. the template file gets locked macro code executed , stays locked long derivative document still open user. it has no impact on ability open new documents based on macro, if want edit template, have ask them close word (and hope nobody else goes it). macro code: documents.add template:="f:\templates\letterhead.dotm", newtemplate:=false, documenttype:=0` the issue template on network drive - pretty common issue. 1 way around have calling template copy on template locally first , create new doc based off of (and delete template when done).

Spring Security Custom Filter (Change Password) -

i'm using spring security securing http requests website. primary usage securing pages such user redirected login page when trying access pages. however, have further requirement. in model, can flag user's password being temporary such that, when login, should automatically forced change password. once password changed, should forwarded on page trying access. has used spring security purpose? need create own custom filter? thanks, andrew in spring security 3.0 can implement custom authenticationsuccesshandler . in handler can redirect user temporary password password change page instead of requested page. after password changed, may redirect user requested page using savedrequestawareauthenticationsuccesshandler , default handler implementation. public class myhandler implements authenticationsuccesshandler { private authenticationsuccesshandler target = new savedrequestawareauthenticationsuccesshandler(); public void onauthenticationsuccess(ht...

LaTex: Pictures in table, caption required -

i have pictures included in table: \begin{tabular}[h]{|l|l|} \hline \includegraphics[scale=0.15]{seite10.eps} & \raisebox{1,1cm}[1,1cm][0cm]{\includegraphics[scale=0.7]{seite24l.eps}}\\ \hline \end{tabular}\newline now want captions pictures. know \caption doesn't work out of float enviroment, tried \captionof instead, didn't work either. cannot write caption in cell of table, because in case figure wouldn't feature in table of figures want generate @ end of file. i'm grateful hint.... to use \captionof load caption package , use inside environment minipage instance. might not work if used directly in simple table cell. this example works, using p cell, \captionof called in parbox : \documentclass{article} \usepackage[demo]{graphicx} \usepackage{caption} \begin{document} \listoftables \bigskip \begin{tabular}[h]{|p{6cm}|l|} \hline \includegraphics[scale=0.15]{seite10.eps} \captionof{table}{test} & \raisebox{1,1cm}[1,1cm][0cm]{\includegr...

xslt - It is possible to set a priority on a "group-starting-with"-clause? -

this example of input file. <root> <!-- [...] --> <bbb>foo 1</bbb> <aaa>xxxxxxxx</aaa> <aaa>xxxxxxxx</aaa> <aaa>xxxxxxxx</aaa> <bbb>foo 2</bbb> <ccc>foo 2.1</ccc> <aaa>xxxxxxxx</aaa> <aaa>xxxxxxxx</aaa> <aaa>xxxxxxxx</aaa> <bbb>foo 3</bbb> <ccc>foo 3.1</ccc> <aaa>xxxxxxxx</aaa> <aaa>xxxxxxxx</aaa> <aaa>xxxxxxxx</aaa> <ccc>foo 4</ccc> <aaa>xxxxxxxx</aaa> <aaa>xxxxxxxx</aaa> <aaa>xxxxxxxx</aaa> </root> i want group nodes bbb , ccc elements. possible there bbb or ccc in input-xml. there following conditions: condition a: group "bbb" or "ccc" element condition b: if "ccc" following "bbb" take them together this outpout-xml want h...

Search on Click with Jquery's Autocomplete -

i trying simulate youtube autocomplete search experience. i can't find option when viewer clicks on listed item , automatically proceeded search said item. my coding follow: <script type="text/javascript"> var data = ['array1','array2']; $(document).ready(function() { $j("input#directorysearch").autocomplete(data); }); </script> the above code allow user click on of listed items, however, fill search box rather automatically searching. i wanted similar behaviour, using jqueryui's default autocomplete widget. trick use 'select' event, submitting select-handler not give desired results, because input not yet have selection filled in. the following code works me though: $("input#searchbox").autocomplete({ source: autocomplete, select: function(event, ui) { $("input#searchbox").val(ui.item.value); $("#searchform").submit(); } }) (in example above...

Upgrade to .net 4.0 framework in Silverlight -

is possible change target framework .net 4.0 in application started in silverlight 3? have upgraded silverlight target silverlight 4 no problem, seems stuck using .net framework 3.5 in actual c# code. (i'm trying use threading tasks if help) i using date version of visual studio 2010. can't seem find explicit way set framework of silverlight (the target framework companion website easy find) thanks everyone. silverlight integration in vs2010 isn't smooth yet. build tools still in beta. ".net framework target" setting has no effect , forgot disable it. silverlight runs on own clr version. prompted silverlight runtime version when create new project. can change afterward project + properties, silverlight tab, "target silverlight version" combobox. you won't find 4.0 in combobox if didn't install yet. that's done separate, after install vs2010. download location is here .

caching - How would you implement an LRU cache in Java? -

please don't ehcache or oscache, etc. assume purposes of question want implement own using sdk (learning doing). given cache used in multithreaded environment, datastructures use? i've implemented 1 using linkedhashmap , collections#synchronizedmap , i'm curious if of new concurrent collections better candidates. update: reading through yegge's latest when found nugget: if need constant-time access , want maintain insertion order, can't better linkedhashmap, wonderful data structure. way possibly more wonderful if there concurrent version. alas. i thinking same thing before went linkedhashmap + collections#synchronizedmap implementation mentioned above. nice know hadn't overlooked something. based on answers far, sounds best bet highly concurrent lru extend concurrenthashmap using of same logic linkedhashmap uses. i lots of these suggestions, think i'll stick linkedhashmap + collections.synchronizedmap . if revisit in future, ...

.net - Invalid postback or callback argument. Event validation is enabled using '<pages enableEventValidation="true"/>' -

i getting following error when post page client-side. have javascript code modifies asp:listbox on client side. how fix this? error details below: server error in '/xxx' application. -------------------------------------------------------------------------------- invalid postback or callback argument. event validation enabled using <pages enableeventvalidation="true"/> in configuration or <%@ page enableeventvalidation="true" %> in page. security purposes, feature verifies arguments postback or callback events originate server control rendered them. if data valid , expected, use clientscriptmanager.registerforeventvalidation method in order register postback or callback data validation. description: unhandled exception occurred during execution of current web request. please review stack trace more information error , originated in code. exception details: system.argumentexception: invalid postback or callback argument. event vali...