Posts

windows - Why does Vista not allow creation of shortcuts to "Programs" on a NonAdmin account? Not supposed to install apps from NonAdmin account? -

i'm working on installer (using wise installer, older version 1999). i'm creating shortcut in programs group exe. i'm creating shortcut on desktop. if install run admin account, create shortcut on common desktop , common program group (i.e., read hkey_local_machine\explorer\shellfor users). if it's installed nonadmin account, install hkey_current_user's desktop , program group. behavior install on: xp nonadmin - desktop , program shortcuts install ok. vista admin - desktop & program shortcuts install ok. vista non-admin, uac off - desktop shortcut installs, program shortcut not . however, program group folder they're supposed installed does created. at end of install, launch program group has shorcut. launches in of above. can manually drag shortcut folder , works fine. i'm bloody baffled. i've tried installing other commercial apps (opera, foxit, firefox) firefox install under nonadmin (and if select other program files,...

Is there a standard ReSharper code style definition that matches all the StyleCop requirements? -

the resharper reformat code feature handy , flexible, particularly new code layout templating flexibility jetbrains have added in version 3.0. is there standard set of code style settings resharper match rules enforced microsoft stylecop , stylecop compliance can easy running resharper "reformat code" feature? try resharper stylecop plugin at: http://www.codeplex.com/stylecopforresharper

Nested master pages in ASP.NET MVC 2 -

i know how make nested master pages in webforms possible in mvc2? know how markup though. i set code depending on criteria. possible code in controller define nested master page , master page? " is possible code in controller define nested master page , master page? " nope. default view engine lets define 1 level of masterpages. see: http://msdn.microsoft.com/en-us/library/system.web.mvc.controller.view.aspx

winapi - Windows CDROM Eject -

does know method programmatically close cd tray on windows 2000 or higher? open cd tray exists, can't seem make close under w2k. i looking method batch file, if possible, api calls ok. here easy way using win32 api: [dllimport("winmm.dll", entrypoint = "mcisendstringa", charset = charset.ansi)] protected static extern int mcisendstring(string lpstrcommand,stringbuilder lpstrreturnstring,int ureturnlength,intptr hwndcallback); public void openclosecd(bool open) { if (open) { mcisendstring("set cdaudio door open", null, 0, intptr.zero); } else { mcisendstring("set cdaudio door closed", null, 0, intptr.zero); } }

design - Example of modern text editor architecutre -

i'm looking design\architectual guidance modern text editors. modern text editor means that: it has support syntax highlighting it has auto-completion (something intellisense) it has advanced navigation capabilities (incremental search, etc.) following properties plus: implemented in managed language (java, .net language) modular architecutre add-in support i'm interested in text editor related design\architecure documents\articles, links open source projects. i'm not interested in general recommendations, oop/design patterns books advertisement. currently i'm analyzing sharpdevelop code editor source code. links similar projects appreciated. the ultimate text editor is, of course, emacs. found the craft of text editing, or, emacs modern world excellent self-study guide basics of writing editor. examples in plain old c, , text might bit dated (it 1991), basic ideas still valid, , thoroughly understand why editor works way does....

objective c - Advanced iPad programming -

i finished learning big nerd ranch guide iphone programming need more advanced book advanced concepts particularly ipad app dev. could please recommend one? the pragmatic ipad book coming out soon. main author, daniel steinberg, writer. can download sample chapters too. there's not know. need learn split-view controllers , popovers. if absolutely must have book now, wrox: beginning ipad seems pretty good, you'll go on lot of info you've learned apress has 1 iphone converts too: beginning ipad development iphone developers . jack nutting (very writer, author of apress cocoa book) second author.

How do I get raw logs from Google Analytics? -

is possible obtain raw logs google analytic? there tool can generate raw logs ga? no can't raw logs, there's nothing stopping getting exact same data logged own web server logs. have @ urchin code , borrow that, changing following 2 lines point web server instead. var _ugifpath2="http://www.google-analytics.com/__utm.gif"; if (_udl.protocol=="https:") _ugifpath2="https://ssl.google-analytics.com/__utm.gif"; you'll want create __utm.gif file don't show in logs 404s. obviously you'll need parse variables out of hits web server logs. log line in apache looks this. you'll have lots of "fun" parsing out various stuff want that, google analytics gets basic javascript tagging comes in this. 127.0.0.1 - - [02/oct/2008:10:17:18 +1000] "get /__utm.gif?utmwv=1.3&utmn=172543292&utmcs=iso-8859-1&utmsr=1280x1024&utmsc=32-bit&utmul=en-us&utmje=1&utmfl=9.0%20%20r124&utmdt=my%2...

c# - How can you create a collection based on multiple IEnumerables -

a class want operate on provides getters of type ienumerable<x> , ienumerable<y> x & y subclasses of base type t. want iterate on contents of both treating them type t. there handy way concatenate both can seen ienumerable<t> ? example: ienumerable<headerpart> headers = templatefile.maindocumentpart.headerparts; ienumerable<footerpart> footers = templatefile.maindocumentpart.footerparts; list<openxmlpart> result = new list<openxmlpart>(); result.concat<openxmlpart>(footers); headerpart , footerpart both subclasses of openxmlpart 3rd line fails: 'system.collections.generic.ienumerable' not contain definition 'concat' , best extension method overload 'system.linq.enumerable.concat(system.collections.generic.ienumerable, system.collections.generic.ienumerable)' has invalid arguments note, can't change either of source data, need create new collect...

java - What is the reasoning behind the Interface Segregation Principle? -

the interface segregation principle (isp) says many client specific interfaces better 1 general purpose interface. why important? isp states that: clients should not forced depend on methods not use. isp relates important characteristics - cohesion , coupling . ideally components must highly tailored. improves code robustness , maintainability. enforcing isp gives following bonuses: high cohesion - better understandability, robustness low coupling - better maintainability, high resistance changes if want learn more software design principles, copy of agile software development, principles, patterns, , practices book.

.net - C# Property Access Optimization -

in c# (or vb .net), compiler make attempts optimize property accesses? eg., public viewclass view { { ... computed here .... } } if (view != null) view.something = somethingelse; i imagine if compiler somehow detect view remains constant between 2 accesses, can refrain computing value twice. these kind of optimizations performed? i understand if view has intensive computations, should refactored function ( getview() ). in particular case, view involves climbing visual tree looking element of particular type. related: references on workings of (microsoft) c# compiler? not in general, no. steven mentioned there numerous factors consider regarding multithreading, if computing might change, you're correct should refactored away property. if won't change, should lazy-load (check if private member null, if calculate, return value). if won't change , depends on parameter, can use dictionary or hashtable cac...

Silverlight c# adding tooltip to textblock -

i generating textblock in c# , want add tooptip displays image , text. how can without xaml? use code this:- textblock txt = new textblock(); txt.text = "hello world"; tooltipservice.settooltip(txt, "some content"); note can replace "some content" uielement containing pretty content wish.

c# - Getting the array key in a 'foreach' loop -

how key of current element in foreach loop in c#? for example: php foreach ($array $key => $value) { echo("$value assigned key: $key"); } what i'm trying in c#: int[] values = { 5, 14, 29, 49, 99, 150, 999 }; foreach (int val in values) { if(search <= val && !stop) { // set key variable } } grauenwolf's way straightforward , performant way of doing array: either use loop or create temp variable increment on each pass. which of course this: int[] values = { 5, 14, 29, 49, 99, 150, 999 }; (int key = 0; key < values.length; ++key) if (search <= values[key] && !stop) { // set key variable } with .net 3.5 can take more functional approach well, little more verbose @ site, , rely on couple support functions visiting elements in ienumerable. overkill if need for, handy if tend lot of collection processing.

regex - How to escape text for regular expression in Java -

does java have built-in way escape arbitrary text can included in regular expression? example, if users enter "$5", i'd match rather "5" after end of input. since java 1.5, yes : pattern.quote("$5");

css - Can I change the appearance of an html image during hover without a second image? -

is there way change appearance of icon (ie. contrast / luminosity) when hover cursor, without requiring second image file (or without requiring hidden portion of image)? here's information image opacity , transparency css . so make image opacity 50%, you'd this: <img src="image.png" style="opacity: 0.5; filter: alpha(opacity=50)" /> the opacity: part how firefox it, , it's value between 0.0 , 1.0. filter: how ie it, , it's value 0 100.

design - Self Testing Systems -

i had idea mulling on colleagues. none of knew whether or not exists currently. basic premise have system has 100% uptime can become more efficient dynamically. here scenario: * hash out system specified set of interfaces, has 0 optimizations, yet confident 100% stable though (dubious, sake of scenario please play along) * profile original classes, , start program replacements bottlenecks. * original , replacement initiated simultaneously , synchronized. * original allowed run completion: if replacement hasn´t completed vetoed system replacement original. * replacement must return same value original, specified number of times, , specific range of values, before adopted replacement original. * if exception occurs after replacement adopted, system automatically tries same operation class superseded it. have seen similar concept in practise? critique please ... below comments written after initial question in r...

java - To prevent a memory leak, the JDBC Driver has been forcibly unregistered -

i getting message when run web application. runs fine message during shutdown. severe: web application registered jbdc driver [oracle.jdbc.driver.oracledriver] failed unregister when web application stopped. prevent memory leak, jdbc driver has been forcibly unregistered. any appreciated. since version 6.0.24, tomcat ships memory leak detection feature, in turn can lead kind of warning messages when there's jdbc 4.0 compatible driver in webapp's /web-inf/lib auto- registers during webapp's startup using serviceloader api , did not auto- deregister during webapp's shutdown. message purely informal, tomcat has taken memory leak prevention action accordingly. what can do? ignore warnings. tomcat doing job right. actual bug in else's code (the jdbc driver in question), not in yours. happy tomcat did job , wait until jdbc driver vendor fixed can upgrade driver. on other hand, aren't supposed drop jdbc driver in webapp's /web-inf/lib...

webserver - How do I write a python HTTP server to listen on multiple ports? -

i'm writing small web server in python, using basehttpserver , custom subclass of basehttpserver.basehttprequesthandler. possible make listen on more 1 port? what i'm doing now: class myrequesthandler(basehttpserver.basehttprequesthandler): def doget [...] class threadinghttpserver(threadingmixin, httpserver): pass server = threadinghttpserver(('localhost', 80), myrequesthandler) server.serve_forever() sure; start 2 different servers on 2 different ports in 2 different threads each use same handler. here's complete, working example wrote , tested. if run code you'll able hello world webpage @ both http://localhost:1111/ , http://localhost:2222/ from threading import thread socketserver import threadingmixin basehttpserver import httpserver, basehttprequesthandler class handler(basehttprequesthandler): def do_get(self): self.send_response(200) self.send_header("content-type", "text/plain") ...

language agnostic - Is help file (or user manual) dead? -

back in days of unix, couldn't close software without reading man page first. came mac , windows consistent menu layout , keyboard shortcuts, still saw paper user manuals shipped in shrinkwrap box, described each , every single operation possible in app. after internet, files became html documents. nowadays web 2.0 applications, hardly see help. if it's there , describe specific tasks. in other words, apps relying more on common sense or don't-make-me-think factor of user base. years ago microsoft came concept called inductive user interface , tells programmers put in instructions on apps itself, not sure how popular idea is. are files, user manuals, , context sensitive online f1 key dead? have failed if user not find out ui? if not, degree of should provide? (both desktop , web app) edit: how documentation/help file mesh agile development methods? example, should developers think twice before ui changes may obsolete bunch of screenshots? have fa...

Jquery closing dialog and removing div -

please help! have designed dashboard uses gadgets. 1 of gadgets creates dialog every time gadget refreshed, creates dialog same id. dialog contains form, there issues getting , submitting value of inputbox since there identical id's on page. what best way destroy newly created dialogs , removing div dom without affecting created dialog? add dialog call: close: function (ev, ui) { $(this).dialog("destroy"); $(this).remove(); }, this destroy dialog , remove div when it's closed.

c - What's the difference between hard and soft floating point numbers? -

when compile c code cross toolchain, linker prints pages of warnings saying executable uses hard floats libc uses soft floats. what's difference? hard floats use on-chip floating point unit. soft floats emulate 1 in software. difference speed. it's strange see both used on same target architecture, since chip either has fpu or doesn't. can enable soft floating point in gcc -msoft-float. may want recompile libc use hardware floating point if use it.