Posts

Showing posts from July, 2014

Is there a Windows Registry "dictionary" that explains the whole (or most of) the Windows Registry? -

i'd able see registry keys used for. book on registry fine well. info on windows vista changes great! oh, how wish there single site registry collectively documented write values there! keep in mind, app can create own set of registry keys , values, it's not ms necessary such effort. though key player! in meantime, there 2 ms sites use startng points when need know particular key/value pair do: windows 2003 registry reference: http://technet.microsoft.com/en-us/library/cc778196.aspx windows 2000 registry reference: http://technet.microsoft.com/en-us/library/cc974061.aspx keep in mind since windows evolving thing, information older versions can helpful. note w2003 bears lot of resemblance xp. sadly, have not found link vista/windows 2008 registries similar above. when need know what's specific key, , it's not found in 1 of above links, try search of key's full path @ http://support.microsoft.com

c# - Avoiding first chance exception messages when the exception is safely handled -

the following bit of code catches eos exception using (var reader = new binaryreader(httprequestbodystream)) { try { while (true) { bodybytelist.add(reader.readbyte()); } } catch (endofstreamexception) { } } so why still receive first-chance exceptions in console? a first chance exception of type 'system.io.endofstreamexception' occurred in mscorlib.dll is there way hide these first chance exception messages? the point of "first-chance" exceptions you're seeing them pre-handler can stop on them during debugging @ point of throwing. "second-chance" exception 1 has no appropriate handler. want catch "first-chance" exceptions because it's important see what's happening when it's being thrown, if catching it. there's nothing concerned with. normal behavior.

Visual Studio 2010 keeps changing my default browser -

opera browser of choice, it's set system default browser. debugging web apps in visual studio prefer ie set default in file-browse with... what's weird here visual studio 2010 keeps changing default browser system default in unknown manner (vs restart 1 of situations). there way persist setting? update: fine folks world of vs have created visual studio extension called world of vs default browser switcher out of scott hanselman's code , still not solution, solid workaround problem. this should solve problem: http://www.hanselman.com/blog/howtochangethedefaultbrowserinvisualstudioprogrammaticallywithpowershellandpossiblypokeyourselfintheeye.aspx

java disc based hashmap -

i'm working on web crawler (please don't suggest existing one, not option). have working way expected to. issue i'm using sort of server/client model server crawling , processes data, put in central location. this location object create class wrote. internally class maintains hashmap defined hashmap<string, hashmap<string, string>> i store data in map making url key (i keep these unique) , hasmap value stores corresponding data fields url such title,value etc i serialize internal objects used spider multi threaded , have 5 threads crawling memory requirements go exponentially. to far performance has been excellent hashmap, crawling 15k urls in 2.r minutes 30 seconds cpu time don't need pointed in direction of existing spider forum users have suggested. can suggest a fast disc based solution support concurrent reading & writing? data structure doesnt have same, needs able store related meta tag values etc. thanks in advance i sugg...

salesforce - VisualForce: Pass a parameter to a custom component inside a repeater -

i can't figure out why isn't working: <apex:repeat value="{!mycontacts}" var="c" > <c:contactrowcomponent contactlastname="{!c.lastname}"/> </apex:repeat> (where on main controller mycontacts returns array of contact objects, , on component contactlastname defined string attribute) this gives me error: literal value required attribute contactlastname in <c:contactrowcomponent> @ line 25 column 27 it seems saying literal value required , not formula? trying impossible, or doing wrong? i have come across issue well. in case because specified default attribute in component attribute can't on fields use formula reason. for instance produce error described when passing in formula value: <apex:attribute type="string" name="value" default="sometext" description="some name value" /> so if remove default attribute error resolved. let me know if solve...

php - what is Deserialize & Serialize in JSON, -

i'm new in json, need use json flash actionscript 3.0. found 1 lib json , have seen terms deserialize & serialize means. json format encodes objects in string. serialization means convert object string, , deserialization inverse operation. when transmitting data or storing them in file, data required byte strings, complex objects seldom in format. serialization can convert these complex objects byte strings such use. after byte strings transmitted, receiver have recover original object byte string. known deserialization. say, have object {foo: [1, 4, 7, 10], bar: "baz"} serializing json convert string: '{"foo":[1,4,7,10],"bar":"baz"}' which can stored or sent through wire anywhere. receiver can deserialize string original object. {foo: [1, 4, 7, 10], bar: "baz"} .

documentation - Can I document Python code with doxygen (and does it make sense)? -

i doxygen create documentation of c or php code. have upcoming python project , think remember python doesn't have /* .. */ comments , has own self-documentation facility seems pythonic way document. can use doxygen? particular aware of? i have done coding in python far on small projects lazy document @ (yeah, know ... let's pretend that's ok now). this documented on doxygen website , summarize here: you can use doxygen document python code. can either use python documentation string syntax: """@package docstring documentation module. more details. """ def func(): """documentation function. more details. """ pass in case comments extracted doxygen, won't able use of special doxygen commands . or can (similar c-style languages under doxygen) double comment marker ( # ) on first line before member: ## @package pyexample # documentation module. # # more details. ##...

c++ - Precompiled headers with GCC -

anyone had success getting precompiled headers working gcc? have had no luck in attempts , haven't seen many examples how set up. i've tried on cygwin gcc 3.4.4 , using 4.0 on ubuntu. i have had success. first, used following code: #include <boost/xpressive/xpressive.hpp> #include <iostream> using namespace std; using namespace boost::xpressive; //a simple regex test int main() { std::string hello( "hello world!" ); sregex rex = sregex::compile( "(\\w+) (\\w+)!" ); smatch what; if( regex_match( hello, what, rex ) ) { std::cout << what[0] << '\n'; // whole match std::cout << what[1] << '\n'; // first capture std::cout << what[2] << '\n'; // second capture } return 0; } this hello world boost xpressive (see below link). first, compiled -h option in gcc. showed enormous list of headers used. then, took @ compil...

HTML.Button in ASP.NET MVC -

starting asp.net mvc preview 3, html.button ( , other related html controls) no longer supported. the question is, equivalent them? i've app built using preview 2, have make compatible latest ctp releases. just write <input type="button" ... /> html. there's nothing special @ html controls.

iphone - UIScrollView bounces when content is smaller than view's size -

how can let scrollview bounce, when content size smaller view's frame , when drag it? like iphone's app search results. see uiscrollview (paging mode) bounces when there 2 or more pages? you'd better set property: scroll.alwaysbouncevertical = yes; scroll.alwaysbouncehorizontal = yes;

installation - How do I find if my particular computer is going to have problems when I install linux? -

the lady gave me laptop keep! i've wanted have linux install play first thing did search stackoverflow linux distro suggestions , found here . mention should search around see if anyone's had problems drivers , distro. know toshiba tecra a5 - havent' booted yet when how should go researching whether drivers compatible ubuntu or whatever choose use? should googling ubunto+drivername or there better resources? you can try linux-on-laptops . quick search shows tecra a5 . you can download livecd version, tell if can of hardware working easily. if livecd works, you're good. if doesn't, can pop out of cd-rom drive. no harm done, , can @ other options.

.net - Using the DLR for (primarily) static language compilation -

i'm building compiler targets .net , i've generated cil directly, generating dlr trees make life fair amount easier. i'm supporting few dynamic features, namely runtime function creation , ducktyping, vast majority of code static. so that's been explained, have following questions: has dlr been used static compilation, outside of small examples on msdn blogs? if so, sort of performance achieved? if not, there fundamentally preventing this? are there better mechanisms of generating code either using dlr or emitting il directly? any insight or references blogs/code/talks appreciated. i'm not aware of using dlr in quite fashion yet, though 1 of intended use cases. 1 interesting thing consider dlr's expression trees have been merged linq expression trees, il being produced linq in as-yet-unannounced future version of visual studio using dlr code. a neat aspect of releasing dlr open source have no idea kinds of interesting things people ou...

c# - Combining ASP.NET MVC and Reverse Proxy with URL Rewrite v2 -

i have need submit data different host name , hoping utilize reverse proxy guide found here iis 7.5 http://learn.iis.net/page.aspx/659/reverse-proxy-with-url-rewrite-v2-and-application-request-routing/ i have added following code system.webserver entry in site's root web.config <system.webserver> <urlcompression dostaticcompression="true" dodynamiccompression="true" /> <staticcontent> <remove fileextension=".js" /> <mimemap fileextension=".js" mimetype="text/javascript" /> </staticcontent> <validation validateintegratedmodeconfiguration="false" /> <modules runallmanagedmodulesforallrequests="true"> <remove name="scriptmodule" /> <remove name="urlroutingmodule" /> <add name="scriptmodule" precondition="managed...

linq - ASP.NET Convert Invalid String to Null -

in application have textbox in formview bound linqdatasource so: <asp:textbox id="mytextbox" runat="server" text='<%# bind("myvalue") %>' autopostback="true" ontextchanged="mytextbox_textchanged" /> protected void mytextbox_textchanged(object sender, eventargs e) { myformview.updateitem(false); } this inside updatepanel change field persisted. also, value of myvalue decimal? . works fine unless enter string cannot converted decimal field. in case, updateitem call throws: linqdatasourcevalidationexception - failed set 1 or more properties on type mytype. asdf not valid value decimal. i understand problem, asp.net not know how convert 'asdf' decimal?. convert these invalid values null. best way this? i think should handle updating event of linqdatasource on page. check invalid strings (use tryparse method or something) , continue base class...

powershell - How do I access the non-IPM_SUBTREE Public Folder Tree with WMI? -

i'm trying verify when oab (offline address book) root folder new oab created powershell. there wmi class exposes this? i'm using powershell, examples or links do. if exchange server exchange 2007, powershell (using exchange snapin) able access running command: get-publicfolder \non_ipm_subtree -recurse if server exchange 2003, need mixture of adsi/ldap query that. reply if exchange 2003.

language features - Are there legitimate uses for JavaScript's "with" statement? -

alan storm's comments in response answer regarding with statement got me thinking. i've seldom found reason use particular language feature, , had never given thought how might cause trouble. now, i'm curious how might make effective use of with , while avoiding pitfalls. where have found with statement useful? another use occurred me today, searched web excitedly , found existing mention of it: defining variables inside block scope . background javascript, in spite of superficial resemblance c , c++, not scope variables block defined in: var name = "joe"; if ( true ) { var name = "jack"; } // name contains "jack" declaring closure in loop common task can lead errors: for (var i=0; i<3; ++i) { var num = i; settimeout(function() { alert(num); }, 10); } because loop not introduce new scope, same num - value of 2 - shared 3 functions. a new scope: let , with with introduction of let statement in e...

Rails route to model instance - by domain name -

i have rails 3 application, say, hotels, hotels belong parent areas. when user hits app (served mongrel >> nginx), want domain name used in request decide area of hotels serve (domain name >> area). achieve can see 2 options: 1) rewrite url nginx, inserting area id after domain name (e.g. birminghamhotels.co.uk => proxy_pass http://myupstream/areas/3 $request_uri). benefits: domain object mapping happens accepted domains defined: nginx.conf. should transparent users (pretty urls possible rewritten). drawbacks: breaks rails url helpers, no more link_to or form_for. hard-coded object reference naughty. 2) catch domain name in routes.rb , area via unique "domain" attribute each area (or has_many if fancy). benefits: should allow use of rails url helpers. requested domain linked directly resource exceptions can handled. drawbacks: without rewriting urls nginx, wouldn't users see: birminghamhotels.co.uk/areas/3/hotels/42 instead of birm...

flash - Using Actionscript 3 to connect to a database -

i'm looking advice on how dynamically create content in flash based on database. thinking export database xml file , use built in actionscript xml parser take care of that, size of xml file may prove prohibitive. i have read using intermediary step (php, asp) retrieve information , pass actionscript can read, prefer not if possible. has worked assql libraries before? or there else missing? unless you're running actionscript on server side (i doubt that), connecting database directly wouldn't smart @ all. connect database client side actionscript you'd have open server accept database connections everyone, , you'd have store access data in swf files , disastrous combination in case disassembles swf files. if size of xml prohibitive, can split somehow, or if impossible, can data server through php or else running on server, example, you'd give relevant parameters in request php file , server side script queries database, builds xml text (that...

git - Compiling workflow with version control -

up till i've used version control simple web-based projects don't have compile stage. i've forked relatively large project follows standard "./configure; make; make install" pattern. i'm unsure proper workflow type of project. what do created files compile process? add lots of stuff .gitignore? hard, because did not create build process , not understand created. checkout project somewhere else each build? seems pain, given build every few minutes. just make sure never add don't know about, i.e. never git add . if so, how cleanup , then? obviously deals compiled code faces, i'm sure there's accepted pattern, not familiar yet. i agree chrisf, don't store binaries generated build in repository. goal should have nice .gitignore file, @ time running git status should show no "untracked files". means git either ignoring or tracking files. one procedure use build .gitignore this: add , commit source proj...

debugging - Different property values on two references to the same object (C#) -

i trying track down elusive bug in application manipulates flowdocument . have shown below 3 consecutive lines of debugging code, output: debug.assert(referenceequals(document1, document2)); debug.writeline(document1.blocks.count); // 1 debug.writeline(document2.blocks.count); // 3 can me understand how 2 references same object can have different values given property? or missing way referenceequals works? thanks, tim edit: if change assertion if block, debugging code never runs ... if (referenceequals(document1, document2)) { debug.writeline(document1.blocks.count); debug.writeline(document2.blocks.count); } ... makes me feel utterly stupid, because referenceequals test working, don't understand why assertion not working. possibilities (some of have discounted in comments): some external process, loading blocks flowdocument, altering value between writes. heisenberg: reading blocks property affects it. happens when reading rows data sour...

Coldfusion 9 CFIMAGE ICC Profiles - Not supported, why? & How to Resolve? -

i'm running cf9 , learned cf9's cfimage tag not support icc profiles, makes "capability" pretty worthless on mac, adds icc profiles screen grabs. has else run this. there work around or solution support icc profiles? telling users images w/o icc profiles supported going leave many scratching heads. i'm not entirely sure you're trying accomplish, might find need cfx_image / cfx_openimage .. they're free alternatives cfimage, , use imagemagick / graphicsmagick support icc. failing that, write own tag in java, it's image libraries support icc.

c# - Passing data between a parent app and a virtual directory -

i have application runs child application in virtual directory. i want pass value parent application, believe session keyed per application, , won't work. to further complicate things, parent application webforms, while child nvelocity mvc. does know trick allows me use sort of session type functionality between virtual applications? edit: webservice isn't had in mind, need pass logged in users username child app. besides, if calling webservice on parent, won't same session, won't know user. sounds web service way go. following: have webforms app create data in database key of kind associated it. pass key in url nvelocity mvc application. allow nvmvc application call web service (rest,xml-rpc,soap,whatever) on webforms app using key passed. this around kind of session keying or cookie-domain problem may have , allow pass nicely structured data.

content restrictions on Android? -

i cannot find articles on content restrictions developing on andriod. there any? client wants make app contains 'strong adult language' sexual position potentially adult imagery. from " android market content policy developers ": developers should not upload or otherwise make available applications or other materials display (via text, images, video or other media) or link to: [...] any material not suitable persons under 18. pornography, obscenity, nudity or sexual activity. there question how these terms enforced, describing not officially allowed. it's possible distribute apps android outside official market, , may want have @ mikandi alternate adult-oriented market...

svn - How good are the tools to migrate to and from Team System? -

i wondering if tried migrating between ts , svn/cc. mean migrating importing , exporting repository between source control systems without losing history. how tools migrate , vsts? i interested in knowing opinion regarding using team system users of svn , continuous integration. edit: assume need history, otherwise why use scm? try tfs2svn... worked great project 1200 tfs changesets. bit fussy setup when svn authentication enabled, otherwise great. http://sourceforge.net/projects/tfs2svn/

python - IRC bot functionalities -

i'm learning python , start small project. seems making irc bots popular project amongst beginners thought implement one. obviously, there core functionalities being able connect server , join channel functionalities included in bots? ideas. unless it's solely educational experience, should use framework core functionality. that said, here's of things bot in home irc channel does: choose 1 item list of options display random entry linux fortunes file display random set of words emacs spook file check every line user , display quote the big lebowski if it's sufficiently similar (this bit my-channel specific :) ) check if link has been mentioned before , who/when (we read same rss feeds , tend duplicate links lot) conduct poll pull given quote our internal qdb check if given link has been posted reddit, , give corresponding reddit thread link if so. if reddit link posted, give direct link instead track last time given nick in channel, , last tim...

python - How to make Django's devserver public ? Is it generaly possible? -

i'm trying out django framework , share/present/show stuff i've made workmate/friends. work in ubuntu under win7 via vmware. wish/desire send current pub-ip port (e.g http://123.123.123.123:8181/django-app/ ) friends test it. the problem - use django's dev server (python /path-to-django-app/manage.py runserver $ip:$port). how make devserver public? edit: oh, there's forgot mention. sad use vmware ubuntu. have shellscript returns me current int-ip 192.168.xx.xx saves in environment-variable ($cur_ip) so, each time want run django's devserver execute python /path-to-django-site/manage.py runserver $cur_ip:8080 at way become http-adress (e.g. http://192.168.40.145:8080/app-name/ ) can use outside virtual machine. test on host (win7) machine. that's reason why asked question. thought there's way use ext-ip , make runserver usabable outise too 192.168.*.* lan-private address -- once you've done proper vmware (or other vm manager) , ...

c# - Bitmap <-> JPEG Conversion -

i have application use image captured mobile camera , sends webservice. putting image in byte[] transmitted. done by: filename = cameracapturedialog.filename; filestream fs = new filestream(filename, filemode.open); byte[] imagebyte = new byte[fs.length]; //file send fs.read(imagebyte, 0, convert.toint32(fs.length)); but perform processing (resizing), hence had put image bitmap object, , after processing convert jpeg. is there way convert jpeg bitmap , jpeg without having no changes in pixels (for testing perform no processing on bitmap)? hence if compare first jpeg second jpeg need files same. what think best solution is? can use else instead of bitmap. suggestion code appreciated. jpg lossy format. lose information because of way encoding algorithm works. you'll never original image jpg, no matter encoder use.

static analysis - How can I analyze Python code to identify problematic areas? -

i have large source repository split across multiple projects. produce report health of source code, identifying problem areas need addressed. specifically, i'd call out routines high cyclomatic complexity, identify repetition, , perhaps run lint-like static analysis spot suspicious (and erroneous) constructs. how might go constructing such report? for measuring cyclomatic complexity, there's nice tool available @ traceback.org . page gives overview of how interpret results. +1 pylint . great @ verifying adherence coding standards (be pep8 or own organization's variant), can in end reduce cyclomatic complexity.

.net 3.5 - Reusing existing templates in custom WPF controls -

i creating custom wpf control class inherits combobox. defining behavior, exiting combobox templates fine purposes , don't want created whole set of templates support different themes. there way specify control uses existing combobox templates? give control default style , set basedon default style of combobox: <style targettype="{x:type local:customcontrol1}" basedon="{staticresource {x:type combobox}}"> </style> this inherit template setter combobox default style.

Google Places API vs AJAX Search API and Local Search Control -

i've started developing small app main goal draw map using google maps api (v3), , show business in area drawn (bars, restaurants , on). i found google places api supposed released month hasn't been. far know point of api offer results google's database of business, later put business in map. however i've found this sample using ajax search api , local search control google maps same thing. so question is, point of new google places api? thank in advance! the places api returns list of locations near specific lat/lng, while local search api allows arbitrary search of google's database of business listings , other pois.

java - j_security_check and JAAS -

i have been given task of implementing login handler. detail handler captures username , password. going use jsp posted servlet. servlet carried out db lookup , validated user credentials. upon successful login redirected unsuccessful takes jsp , displays appropriate error messages. however upon doing research discovered j_security_check , jaas , not sure use or whether @ all. what benefits either , suitable task? ? security composed of following aspects: authentication authorization transport layer security - encryption authentication: - consists of checking credentials of user; of times implemented through login mechanism. task of creating login page part of authentication. authorization: - application resources need protected unauthorized access means when ever user requests protected resource, application need ensure user has appropriate access rights. done assign roles user , putting request filters verify access rights of user. part more critical , ...

user interface - GUI Design: How do you do it? -

do draw windows before constructing them? use? i've tried pencil plugin ff. i've tried ms visio. i've tried paper & pencil. i've tried designer vista. etc. etc. etc. i'm leaning toward paper & pencil, you; what's preference? balsamiq mockups looks pretty nice http://www.balsamiq.com/products/mockups

svn + repository location -

i set subversion server accessed via svn+ssh. wondering, default repository location (on unix box). do put in /opt/svn or /home/svn or /usr/subversion or even /svn or somewhere else? i looking place, people put it. there convention? edit: it absolutely possible "hide" actual repository location user. example (in case) wrapping svnserve executable in way called like: svnserve -r /var/svn/repos i typically place repositories somewhere under /var , in /var/lib/svn - i'm trying follow filesystem hierarchy standard has purpose of /var : /var specified here in order make possible mount /usr read-only. once went /usr written during system operation (as opposed installation , software maintenance) must in /var .

c# - is it possible to move from asp.net validators to jQuery validators -

is possible move asp.net validations j query validations without effort .i need validation summary control. using jquery validation asp.net webforms .

objective c - Maximum size of UIImage tiles for iPhone 4 -

i have iphone app containing large static image, sliced 1024x1024 tiles , put in uiscrollview. i'm not clear whether can use larger tiles on iphone 4. if want support double-res image iphone 4, should i: create 2048x2048 tiles @2x suffix or create 4 times many 1024x1024 tiles , write logic load in these tiles on iphone 4 for iphone 4 create 2048x2048 tiles @2x suffix. have not change code. add these images.

Hidden Features of F# -

this unabashed attempt of similar c# question. so favorite f# hidden (or not) features? most of features i've used far aren't hidden have been quite refreshing. how trivial overload operators compared c# or vb.net. and async<t> has helped me shave off real ugly code. i'm quite new language still it'd great learn other features being used in wild. user defined numeric literals can defined providing module name starts numericliteral , defines methods ( fromzero , fromone , etc.). in particular, can use provide more readable syntax calling languageprimitives.genericzero , languageprimitives.genericone : module numericliteralg = begin let inline fromzero() = languageprimitives.genericzero let inline fromone() = languageprimitives.genericone end let inline genericfactorial n = let rec fact n = if (n = 0g) 1g else n * (fact (n - 1g)) fact n let flt = genericfactorial 30. let bigi = genericfactorial 30i

Can PHP PDO Statements accept the table or column name as parameter? -

why can't pass table name prepared pdo statement? $stmt = $dbh->prepare('select * :table 1'); if ($stmt->execute(array(':table' => 'users'))) { var_dump($stmt->fetchall()); } is there safe way insert table name sql query? safe mean don't want do $sql = "select * $table 1" please see following: http://us3.php.net/manual/en/book.pdo.php#69304 table , column names cannot replaced parameters in pdo. in case want filter , sanitize data manually. 1 way pass in shorthand parameters function execute query dynamically , use switch() statement create white list of valid values used table name or column name. way no user input ever goes directly query. example: function buildquery( $get_var ) { switch($get_var) { case 1: $tbl = 'users'; break; } $sql = "select * $tbl"; } by leaving no default case or using default case returns error message ens...

dom - jQuery parent selectors -

is there jquery parent selector traverses dom until first match found? eg: <tr> <td> <div id="foo">hello!</div> </td> </tr> to find row div using: $('#foo').parent().parent(); it feels should able write like $('#foo').firstparent('tr'); but can't find such function in docs. you can use .closest() this: $('#foo').closest('tr'); if helps, there's category narrow future searches to: tree traversal

c# - Producer/Consumer, Stream buffer problem -

i'm trying write buffermanager manages 3 streams. typical usage slow producer , fast consumer. idea behind 3 buffers producer has buffer write in , consumer gets latest data produced. now have this, , sort-off works. namespace yariifstream { /// <summary> /// class manages 3 buffers used if data streams /// </summary> public class yariifstream { private stream writebuf; ///<value>the stream used writing</value> private stream readbuf; ///<value>the stream used reading</value> private stream swapbuf; ///<value>the stream used swapping</value> private bool firsttime; ///<value>boolean used checking if first time writebuffers asked</value> private object sync; ///<value>object used syncing</value> /// <summary> /// initializes new instance of yari.yariifstream class expandable buffers /// </summary> pu...

PHP: Convert variable to array -

i'm trying convert variable array , split each character using php. so have variable $name = 'john smith'; how convert to: array('j','o','h','n',' ','s','m','i','t','h'); notice space between john , smith well. thank you. there's str_split that.

Drupal 6 administer nodes permission is ignoring content type permissions -

i'm needing set different 'create content' permissions different user roles. appears work when particular role has not been given "administer node" permission. however, without permission role not have permission control whether or not node published (which require) or view content management table (home › administer › content management). for example, want user role able create new news items , able publish/unpublish them, not create new pages (but able edit existing pages). does know way around this? or permissions should set? administer nodes permission gives more access necessary, , modules use crutch permission since exists. you might want switch off permission , implement override node options module let users publish unpublish content. these can work in conjunction create/edit/delete permissions @ content type level.

.net - How do I enable double-buffering of a control using C# (Windows forms)? -

how enable double-buffering of control using c# (windows forms)? i have panel control drawing stuff , owner-drawn tab control. both suffer flicker, how can enable double-buffering? in constructor of control, set doublebuffered property, and/or controlstyle appropriately. for example, have simple doublebufferedpanel constructor following: this.doublebuffered = true; this.setstyle(controlstyles.userpaint | controlstyles.allpaintinginwmpaint | controlstyles.resizeredraw | controlstyles.containercontrol | controlstyles.optimizeddoublebuffer | controlstyles.supportstransparentbackcolor , true);

html - How can I reorder my divs with CSS? -

given template html cannot modified because of other requirements, how possible display (rearrange) div above div when not in order in html? both div s contain data varies in height , width. <div id="wrapper"> <div id="firstdiv"> content below in situation </div> <div id="seconddiv"> content above in situation </div> </div> other elements hopefully obvious desired result is: content above in situation content below in situation other elements when dimensions fixed easy position them needed, need ideas when content variable. sake of scenario, please consider width 100% on both. i looking css solution (and have met other solutions if doesn't pan out). there other elements following this. suggestion mentioned given limited scenario demonstrated -- given might best answer, looking make sure elements following aren't impacted. this solution uses css , works v...

JavaScript library for syntax highlighting for code, then diffs, in HTML, at the line level? -

anyone know of js library allow me syntax highlight code block, highlight line-level diffs? example, in subversion diff, i'd highlight characters on line have changed (as highlighting fact there change(s) on line). edit: i'm after let me syntax highlight according language, syntax highlight fact it's diff, , ideally, on top, highlight changed-characters on lines have changed. saw gallio not-equal assertion-exceptions, haven't looked @ yet. the google syntax highlighter great, , supports lots of languages. i'm not sure if supports diffs though, think it's quite extensible.

ruby on rails - Difference between ActiveMailer and Mail gem? -

in ruby on rails 3 can use activemailer sending emails. also can install mail gem. i wonder difference is? does mail gem provide things activemailer doesnt? should install gem? thanks the relationship between 2 mail gem how rails 3 implements mail ( replacing previous tmail approach in earlier versions). in other words, actionmailer rails wrapper around mail gem's usage within framework. from post gem's author: the prior versions of actionmailer used tmail email delivery needs, , because functionality missing in tmail (such auto quoting , encoding of fields, handling multipart emails smoothly, etc.), actionmailer had grown set of complex , fragile methods shoehorn in missing functionality. that post here . , screencast might helpful if haven't seen already.

Why the region name not printing in Visual Studio 2010 when "hide collapsed region" is selected? -

in visual studio 2008, when print code "hide collapsed region", print result include region header name. for example, if code looks this: using ... namespace foo { #region myregion1... #region myregion2... public void someaction{} } in visual studio 2008 print, looks like: using ... namespace foo { myregion1 myregion2 public void someaction() } however, in visual studio 2010, looks like: using ... namespace foo { public void someaction() } notice region name not printing, leaves empty space. bug in vs 2010, or redesigned hide entire region blank space. can't find option change behavior. what describe happens vs 2010 installation. assume design (or perhaps thoughtlessness, although seems hardly believable, since included feature through explicit checkbox option). fyi, tried changing behavior through modifying printer syntax highlighting settings, no avail.

c# - Where is the information about the entry point of an assembly written in the assembly? -

i used think assembly have 1 main() method until saw jon skeet's miscutil in video lecture delivered @ microsoft office in copenhagen. so, wrote little app had 2 main() methods so: namespace manymains { class program { static void main(string[] args) { console.writeline("hello, world!"); console.readkey(); } } class yetanotherprogram { static void main() { console.writeline("yet program."); console.readkey(); } } } i set startup object in visual studio , worked. okay, no cause distress. then, wanted see information stored in assembly, opened compiled binary in reflector , saw absolutely no metadata effect. i'm wondering if sort of information written manifest or coff header of pe image can't seen in disassembler seen in hex editor? i opened 1 of executables in il disassembler. notice .entrypoint line main method. ...

sql server - Text overflow when using nvarchar(max)? -

i've run strange situation seems involve long text overflowing. i'm using fn_pcre_replace (from xp_pcre extended stored procedure ) on nvarchar(max) column, , when replace more characters there originally, returns null if original string on 8000 characters long. for example, select master.dbo.fn_pcre_replace(overview,'a', 'x') projectcontent works expected, this select master.dbo.fn_pcre_replace(overview,'a', 'xxx') projectcontent returns null in cases (apparently, wherever len(overview)>8000 ). is limitation of xp_pcre , or there can in sql make work? this limitation of xp_pcre . looking @ source: switch (btype) { case srvbigchar: case srvbigvarchar: break; default: throw xpexception( stringbuilder() << "invalid data type on parameter " << paramnum << " (should char or varchar)." ...

ftpwebrequest - Can explicity ftps via Filezilla but not from code -

This summary is not available. Please click here to view the post.

Accessing command line arguments in C -

please forgive me if noob question, i'm beginner @ c, learning while. tried write program sums 2 numbers (provided params application). code this: #include <stdlib.h> #include <stdio.h> int main( int argc, char** argv) { int = atoi(argv[0]); int b = atoi(argv[1]); int sum = a+b; printf("%d", sum); return 0; } but incorrect results - huge numbers small inputs 5 , 10. wrong here? the first argument program name of program itself. try using following instead. int = atoi(argv[1]); int b = atoi(argv[2]);

How do I check if an array includes an object in JavaScript? -

what concise , efficient way find out if javascript array contains object? this way know it: function contains(a, obj) { (var = 0; < a.length; i++) { if (a[i] === obj) { return true; } } return false; } is there better , more concise way accomplish this? this closely related stack overflow question best way find item in javascript array? addresses finding objects in array using indexof . current browsers have array#includes , exactly that, is supported , , has polyfill older browsers. you can use array#indexof , less direct, doesn't require polyfills out of date browsers. jquery offers $.inarray , functionally equivalent array#indexof . underscore.js , javascript utility library, offers _.contains(list, value) , alias _.include(list, value) , both of use indexof internally if passed javascript array. some other frameworks offer similar methods: dojo toolkit: dojo.indexof(array, value, [fromindex, findlas...

dos - Windows 'dir' command, Order By Name AND <something> -

we can see in directory files ordered name in windows explorer. if try same thing in ms-dos orders name differently - correctly : dir *.jpg /on /b cubierta.jpg pag00.jpg pag06.jpg pag08.jpg pag09.jpg pag100.jpg pag101.jpg pag102.jpg pag103.jpg pag104.jpg pag105.jpg pag106.jpg pag107.jpg pag108.jpg pag109.jpg pag11.jpg, etc, etc, etc, ... is there way msdos order name reads numbers human do? thanks! your best option (if possible) add enough leading zeros (two, in case) smaller numbers sort come out expected.

javascript - JQuery Pulsate - Weird behaviour with Firefox -

i'm trying pulsate text using jquery, gives jagged edges when using firefox, tried isolate problem, , happens when change text color red using css. seems if there bits of black left. works ok in other browsers, ie, i'm bit confused now. here's code: <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script> <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/jquery-ui.min.js"></script> <script> $(document).ready(function() { $(".blink").effect("pulsate", { times:100 }, 2000); }); </script> </head> <body> <div class="blink"> <p style="color:red;">the text pulsated</p> </div> </body> after looking @ cdutson's comment, did quick research. looks ie uses "cleartype" default, whereas other applications firefox use system s...

objective c - Iphone opengl es - glu, glPushName -

using iphone , objective c im trying find plane has been clicked/touched in opengl view. typically use glpushname/ flpopname function doesn't seem implemented in sdk or defined in . know there useful functions or way object clicked? opengl es doesn't support these functions. you'll have find way pick. either: render solid faces distinct colors low-res buffer. select render buffer resolution pick square occupies 3x3 pixel grid, choose either color in center pixel, or color occupies edge pixels. determine pick geometrically. entails placing geometry in bsp of sort , doing interesection tests ray emanating downwards screen, starting tapped pixel. determine pick analytically. if geometry simple and/or regular enough, might able use straightforward math find out tapped.

Which exception should I raise on bad/illegal argument combinations in Python? -

i wondering best practices indicating invalid argument combinations in python. i've come across few situations have function so: def import_to_orm(name, save=false, recurse=false): """ :param name: name of external entity import. :param save: save orm object before returning. :param recurse: attempt import associated objects well. because need original object have key relate to, save must `true` recurse `true`. :raise badvalueerror: if `recurse , not save`. :return: orm object. """ pass the annoyance every package has own, differing badvalueerror . know in java there exists java.lang.illegalargumentexception -- understood creating own badvalueerror s in python or there another, preferred method? i raise valueerror , unless need more specific exception.. def import_to_orm(name, save=false, recurse=false): if recurse , not save: raise valueerror("save must true if recurs...

visual c++ - Is there a way to use java to execute a series of command line -

i'm looking way compile visual studio c++ project in java. know it's bit strange way. i'm doing evolutionary algorithms. java creating c++ code , compile in java not c++. need automate it, don't have copy c++ code , paste in .net , click compile it. so i'm looking way execute series of command lines , display result in eclipse console. can that? first need setup visual studio environment, need run batch first c:\program files\microsoft visual studio 9.0\vc\vcvarsall.bat , change directory c++ project , compile project using "cl.exe" , "link.exe". need executed in specific order. create batch file , run using processbuilder. import java.io.*; import java.util.*; public class doprocessbuilder { public static void main(string args[]) throws ioexception { if (args.length <= 0) { system.err.println("need command run"); system.exit(-1); } process process = new proce...

python - jira SOAP and XMLRPC -

i wondering if there urls various calls can made jira. issues, users. format in xml? json? i want write wrapper class in python. see soap api exsists no methods definitions in python anywhere can find. found java 1 easy. your appreciated. please , thank you. the atlassian site has samples right on it. using soap client interact jira: http://confluence.atlassian.com/display/jira/creating+a+soap+client and using xml-rpc interact jira: http://confluence.atlassian.com/display/jira/creating+a+xml-rpc+client also check out documentation have api: http://confluence.atlassian.com/display/jira/jira+xml-rpc+overview

type conversion - How do I convert a string to a decimal in unity javascript? -

how convert string decimal in unity javascript? do mean javascript in unity 3d? if are: unity uses mono, should have access float.parse(str) or decimal.parse(str) . (or qualified names system.single.parse(str) or system.decimal.parse(str) )

.net - How to prevent Visual Studio from launching WcfSvcHost.exe while debugging? -

i have solution in visual studio 2008 has multiple projects. 1 of projects wcf project. want debug other projects, when press f5, visual studio has wcfsvchost.exe launched host wcf project not "startup project". currently, every time debugging other projects, have unload wcf project prevent annoying wcfsvchost.exe host pop up. however, not convenient. know better idea prevent wcf project hosted in debugging mode? go wcf options section in property page of wcf project , unselect check box says 'start wcf service host when debugging project in same solution'.

c++ - Give a name to a boost thread? -

is possible give name boost::thread debuggers tables , crash logs can more readable? how? you need access underlying thread primitive , assign name in system dependent manner. debugging , crash logs inherently system dependent , boost::thread more non-system-dependency, i.e. portability. it seems ( http://www.boost.org/doc/libs/1_43_0/doc/html/thread.html ) there no documented way access underlying system resources boost thread. (but have never used myself may miss something.) edit: (as david writes in comment) http://www.boost.org/doc/libs/1_43_0/doc/html/thread/thread_management.html#thread.thread_management.thread.nativehandle

c# - Post build visual studio step not being called at all -

the long of built installer in visual studio gave me cheery error when tried use program: retrieving com class factory component clsid {ec10e7e8-797e-4495-a86d-3e9eada6d5bb} failed due following error: 80040154. from seems need embed manifest in executable , should add post build event following: "$(devenvdir)....\vc\bin\mt.exe" -manifest "$(projectdir)$(targetname).exe.manifest" –outputresource:"$(targetdir)$(targetfilename)";#1 well, when , build solution event not being called @ all. in fact, can put old random text in pre , post events , no error ever given nor see being called. is there should doing differently make work? additional information: i'm building ide. , when toggle build types debug , release still correct command in post build events. is there way see log of it's doing? tool + options, project , solutions, build , run, set "msbuild project build output verbosity" detailed. ...

sql - MySQL - group rows in 4's -

i have product table this: product name , affiliate id , productcode a, 1, 1 b, 1, 2 c, 1, 3 d, 1, 5 e, 1, 7 f, 2, 4 g, 2, 6 i want return first 4 products each affiliate id. 'productcode' column signifies order in products added, can use column sort results. don't know how return first 4 results each affiliate id? if use 'group' function returns 1 row of each affiliate id. look example in link: within-group quotas (top n per group) it need. select affiliateid, productcode ( select affiliateid, productcode, if( @prev <> id @rownum := 1, @rownum := @rownum+1 ) rank, @prev := id table join (select @rownum := null, @prev := 0) r order affiliateid, productcode ) tmp tmp.rank <= 4 order affiliateid, productcode;

Generate image thumbnails with watermarks on the fly in PHP -

i'm looking php class (solution) generating image thumbnails watermarks on fly. idea ? i've used code add text (thumbnail) image: (note you'll need provide font) function createimage($in_filename, $out_filename, $width, $height) { $src_img = imagecreatefromjpeg($in_filename); $old_x = imagesx($src_img); $old_y = imagesy($src_img); $dst_img = imagecreatetruecolor($width, $height); imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $width, $height, $old_x, $old_y); addwatermark($dst_img); imagejpeg($dst_img, $out_filename, 80); imagedestroy($dst_img); imagedestroy($src_img); } function addwatermark($image) { $text = "watermark text"; $font = realpath($_server["document_root"] . "/code/courbd.ttf"); // case sensitive if ($font == false) return; $fontsize = 11; $borderoffset = 4; $dimensions = imagettfbbox($fontsize, 0, $font, $text . "@"); $linewidth...

ajax - JavaScript implementation of Gzip -

i'm writing web application needs store json data in small, fixed-size server-side cache via ajax (think: opensocial quotas ). not have control on server. i need reduce size of stored data stay within server-side quota, , hoping able gzip stringified json in browser before sending server. however, cannot find in way of javascript implementations of gzip. suggestions how can compress data on client side before sending up? edit there appears better lzw solution handles unicode strings correctly @ http://pieroxy.net/blog/pages/lz-string/index.html (thanks pieroxy in comments). i don't know of gzip implementations, jsolait library (the site seems have gone away) has functions lzw compression/decompression. code covered under lgpl . // lzw-compress string function lzw_encode(s) { var dict = {}; var data = (s + "").split(""); var out = []; var currchar; var phrase = data[0]; var code = 256; (var i=1; i<data....

What is the standard 'trunk' site equivalent for Mercurial? -

we moving mercurial subversion. subversion, have http://trunk.myproduct.com testing purposes. wondering standard name trunk-like site mercurial. 'trunk' seems subversion term. http://default.myproduct.com obvious name, people use? looking standard convention. i'm not sure there convention. people using mercurial have more repositories. i've seen "central" repository named bits.example.com, example.com/hg, example.com/branches/1.x, , on. name whatever - make sure have standard convention changes go repository, , when.

Conditional Configuration Framework -

i'm searching configuration framework handles key/values pairs based on conditions. language , storage type doesn't matter. example background color application xyz: application has background color "red". on monday background color should green. the background color user xyz on monday should orange. the developer ask "application.background.color" , should return correct value based on given conditions. in java, have @ commons configuration. need extend somewhat, should able use existing frameworks variable expansion, providing can define available context elements in advance.

svn - Branches for Every Little Change? -

we have client (who has client, has client) driving mad change requests code base (in php). our first response work in main trunk in svn, client comes , requests change needs pushed live servers asap. on other hand, other changes reduced in priority suddenly, came grouped other changes (seemingly). we thinking of using branch every change request. mad? other solutions might work? thanks! edit : hard question choose correct answer for. great answers. edit : know best answer chose not particularly popular. wanted find technical solution problem. think if client wants software features can deployed in modular fashion... problem should not solved in our use of version control system. have designed software. edit : it's month later , coworker/client has convinced me multiple branches way go. not due client's insanity, based on our need able determine if feature "ready go" or "needs more work" or whatever. don't have svn me, merge using advice ...

windows mobile - Smartphone-style ComboBox behavior on PocketPC platform? -

i develop applications pocketpc platform (.net compact framework 2.0 , higher), , 1 of problems run in drop-down width combobox controls not wide enough show long string values. i've run across p/invoke methods widen dropdown width, i'd have smartphone-style behavior comboboxes. this, mean initial view of spin control (left/right arrows scroll through option list), , if click action button takes full-screen rendition of options easier read. i think create custom user control simulate behavior on pocketpc, know if it's possible @ actual smartphone functionality , use that. faster tap existing functionality if possible. i don't think possible, because behavior in combobox how pocketpc smartphone os handles comboboxes. if compile smartphone app combobox , run in regular pocketpc, combobox won't behave way (i think).

JavaScript: Is there an element geometry changed event? -

there resize dom event, generic elements can't find event fired when position of element changed. i'd have event fired whenever geometry of element changed. can mozilla specific, because write firefox add-on. edit: or there way pin element 1 works, no matter crazy stylesheets might used (so 1 on top of other)? edit: or there way pin element 1 works, no matter crazy stylesheets might used (so 1 on top of other)? you can set bunch of !important rules, take priority (unless else uses !important , rare): .pinned { position : absolute !important; top : 0px !important; right : 0px !important; bottom : 0px !important; left : 0px !important; }

Debugging Web Requests on an Android Device -

is there way route requests made through web browser on android device through fiddler? debug web requests device making when load web page, , equivalent emulator not giving me same results. thanks, dave morris you can set emulator run web requests through proxy . there ways set own code use proxy. not aware of way have production device use proxy built-in web browser, though.

Problem mixing webforms into ASP.NET MVC application -

i've been trying idea of taking existing asp.net webforms application , converting hybrid going forward, can asp.net mvc. in order this, created asp.net mvc application , started copying of folders asp.net webforms projects contain webforms. i'm having problem building resulting project getting hundreds of compile errors of form: error 1951 'documents_admin_docpushbytag' not contain definition 'ctlcategorylist' , no extension method 'ctlcategorylist' accepting first argument of type 'documents_admin_docpushbytag' found (are missing using directive or assembly reference?) each of these error messages refer server controls in markup. it's if mark-up not getting parsed? when edit 1 of code behind files , type this. see intellisense recognizes, these controls don't appear. event handlers (but must because defined in code behind file). far can tell, codefile , inherits page attributes correct (and unchanged asp.net proj...