Posts

Paypal Website Payments Standard -

i'm having trouble finding out how set up. documentation horrendous @ best. called paypal , told them need: have own custom shopping cart client doesn't want pay monthly fee i told use website payments standard send cart contents , user can choose sign in/pay or pay cc without account. every link on documentation sends me silly html button creator. don't need hand-holding through coding, need know can find proper documentation. don't want paypal buttons send customers paypal cart page every time add something. https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_id=developer/e_howto_html_cart_upload this looking for. took 3+ hours find, congrats paypal. you've stolen money in past, you've stolen time. helps else looking same thing.

winapi - How to refresh Windows Explorer -

Image
a network volume's name can changed. changed name spinal disk to change network name, do write new name in registry. attach network volume using functions definedosdevicew. in timing, windows explorer read registry in guessing. shchangenotify(shcne_driveadd, shcnf_path, root, null); // sure. sendmessagetimeout(hwnd_broadcast, wm_devicechange, message, (lparam)(&dbv), - smto_abortifhung, 200, &dwresult); // sure again! it works, doesn't work though use shchangenotify , wm_devicechange sure. sometimes, new name not applied in windows explorer. if terminate explorer , re-execute, name applied. i'm finding interface having windows explorer refreshed.(is correct syntax? sorry, can't express sentence well.) there proper function? explorer should re-read registry , refreshed. unfortunately, explorer can't refresh every time told so. because way many apps behave badly, , use shchangenotify() shcne_allevents. imagine if exp...

python - Sqlalchemy type for very long text for articles -

what type should define in sqlalchemy definition text article or blog entry? i'm using mysql. column('article_text', ???) column('article_text', sqlalchemy.unicodetext()) that should work on supported database, not mysql.

iphone - Custom behavior when "back" button in nav bar pressed -

i know can add custom "back" button uinavigationbar, doing removes existing button tapered left side, described in what happens when button pressed in navigationbar is there way keep existing behavior , of button, informed when pressed? basically, want app play sound whenever button touched. can uitabbarcontroller via delegate, delegate uinavgationbarcontroller has no such functionality. the following possibilities view controller disappear. clicking on button (other backbarbuttonitem ). clicking on backbarbuttonitem either case viewwilldisappear: method called. keep boolean flag . lets name isanybuttonclicked . , set isanybuttonclicked = yes whenever button clicked. , override viewwilldisappear: method, , play sound if no button clicked(ie., isanybuttonclicked == no ). viewwilldisappear: like, - (void)viewwilldisappear:(bool)animated { [super viewwilldisappear:animated]; if (!isanybuttonclicked) { // play sound isanybu...

oop - How to provide specific GWT implementations -

suppose working on exposing of server-side classes gwt application, parts done better using gwt-specific components (like jsni, instance). what techniques doing without being hacky? for instance, aware of using subpackage , using <super-source/> tag, requires package names different, causes eclipse complain. general solution in community tell eclipse use source folder, eclipse complains there being 2 classes same name. ideally, there way keep in single source tree, , have different classes apply alternate implementations. feel more oo approach. i add suffix class _gwt accomplishes automatically, , know write script kind of transformation, kludge sure. i've been considering using google's gin/guice libraries projects in general, , think there might kind of solution there, not sure have not thoroughly investigated it. what solutions have tried in past on gwt projects? the easiest way have split implementations use super-source code, enough instan...

delphi - TJvHidDeviceController "DevicePath" always showing "\" -

i'm using tjvhiddevicecontroller class retrive hid device information. have plugged 2 hid devices, i'm trying ge "devicepath" of sp_device_interface_detail_data_a structure getting device path '\'. ican't open createfile function. please me solve issue. os win7. all. this guessing! the 1 thing can think of is: tjvhiddevicecontroller calls windows api call without using or w suffix. structure used sp_device_interface_detail_data_a, ansi version. now, if use delphi 2009 or higher, routine expect sp_device_interface_detail_data_w. size same looks ok. strings stored usc2 encoded (widechars) instead of ansi encoded -> after every ansi character there null byte. tjvhiddevicecontroller converts character array pascal string using function strpas , hence, see first character. check: set breakpoint after function call fills structure , use cpu window view content memory dump. if see ansi characters every other byte , null bytes in between, ca...

android - Uploading video on server through POST -

i know how can upload video file on server using post in android. please, let me know answer, if knows it? thanks take @ httpurlconnection . has sample code showing how post.

php - My website is taking a long time processing and opening pages. Why? -

i have developed web portal in joomla, images oriented, hence there lots of images on site. website taking long time processing , opening pages. reason, , how can resolve it? one major thing check optimizing images. link nick provided in previous answer yahoo best practices provide information. if working joomla out of box say, culprit images using. make sure you're images correct display size, not larger. don't use html size image height , width command this: <img src="someimage.jpg" height="400" width="600" > use photo editor make image actual size need.

asp.net - Hashing vs. Encrypting Passwords -

i'm using asp.net membership site serve sophisticated users. understand difference between hashed , encrypted passwords, , i'm trying decide between two. after last client complained bitterly hashed passwords being total pita, i've started favor encrypted passwords. suggested isn't secure enough. so question is: what, risks of encrypting passwords? person ability steal passwords decrypting them database surely have ability reset them if hashed, no? i'm having trouble seeing cause trouble encrypted passwords couldn't hashed ones. making convenient users important. the risk decryptable passwords people use 1 password various logins , accounts, not application dealing with. with encrypted password, stolen/decrypted password tried out on users' other accounts (e.g. stolen banking password lead access email). with hashed password, there no recovery. theft of password hashes should never yield usable passwords treat passwords property of ac...

android - Call widget's onUpdate method from the app's main activity -

i'm working on android application includes widget. main interface of app simple activity, of things users can in activity make necessary update widget - i.e. run onupdate method. how can trigger method activity? looking @ other questions , i've been able write code changes layout, doesn't seem run onupdate (since i'm left empty layout , none of data added during onupdate). any ideas or code samples appreciated! i still pretty new android, accomplished 3 steps: first, put contents of appwidgetprovider.onupdate in method ( myupdate(context) ). second, overrode appwidgetprovider.onreceive() this: public void onreceive(final context context, final intent intent) { super.onreceive(context, intent); if (my_public_static_string.equals(intent.getaction())) { myupdate(context); } } third, other activity, send generic broadcast action set on intent. intent updatewidgetintent = new intent(context, mywidget.class); updatewidg...

how to change the row background colour based upon some criteria in EXTJS -

dear sir/madam, i'm new extjs coding.i'm learning it.i've come across problem of changing row background colour based upon criteria in complete extjs coding.can me,please ? you have use getrowclass method in gridview set custom css class of row: viewconfig: { forcefit: true, showpreview: true, // custom property enablerowbody: true, // required create second, full-width row show expanded record data getrowclass: function(record, rowindex, rp, ds){ // rp = rowparams if(record.get('isred')){ return 'x-grid3-row-red'; } } }, where have defined css class x-grid3-row-red. look method getrowclass in documentation: http://dev.sencha.com/deploy/dev/docs/?class=ext.grid.gridview

opengl es - Cocos2D: increasing Sprite Brightness -

is there way adjust brightness of ccsprite without using overlay sprite or creating separate texture? color property doesn't work since can decrease brightness. i thinking possible overriding draw method , adding opengl calls similar found in http://developer.apple.com/library/ios/#samplecode/glimageprocessing/introduction/intro.html , of attempts have failed , novice @ writing raw opengl. know if possible , calls need made? although not same brightness, more bright. [sprite setblendfunc:(ccblendfunc){gl_src_alpha, gl_one}];

Tail Recursion vs Forward recursion in Erlang -

is tail recursion better forward recursion perfomance in erlang? or erlang compiler optimizes forward recursion too? mean, there reasons use tail recursion instead of forward recursion? in opinion, forward recursion looks more pretty. tail recursion better because uses less memory. bring need onto next call, minimizes memory utilization on stack. also, when tail recursive code optimized, function returns not needed thrown away make faster in cases. for example, if function's return value call function, there no need keep intermediary function on stack. code jumps directly caller inner function. non-tail recursion optimized tail recursion in cases erlang compiler, don't count on it. make habit code tail recursive functions whenever can.

Is using the "escape" tag really mandatory as a good security pattern in Django? -

in the security chapter of the django book , says must use template tag {% escape %} in order protect site cross-site scripting. is necessary put escape tag on every single template string? there way specify @ application level? that version of django book written before 1.0 came out, , out of date. template content has been autoescaped quite time now.

asp.net - Advantages of .NET 3.5 vs 2.0, for customers -

did ever have persuade customers migrating asp.net web forms application 2.0 3.5 necessary? why customers should install new framework? (and new operating system - there lot of windows 2000 machines out there although support ended in 2010 ). which advantages them? security? performances? costs? is reason 2.0 old ? any link appreciated. ps: please don't answer 3.5 has linq, it's advantage developers not customers the advantage here indirectly customer, (hopefully) allowing write code faster/shorter , therefore fewer bugs , more deadlines hit. there may small performance increases newer iterations of franmework.

visual studio 2010 - Debug single role instance with Azure Compute emulator -

i'm building application run on azure. visual studio solution contains multiple azure role projects. when debugging locally, use azure compute emulator. to start debugging, follow these steps: i right-click on azure project , click set start project. i press f5 start debugger. what happens emulator/vs2010 launches both web roles , worker roles, if i'm interested in debugging single worker role @ moment. when writing background-processing code in worker role, i'm interested step through code without starting web role, launch internet explorer , on well. is there convinient way make debugger launch 1 of role instances , not of them? i'm thinking of creating separate project in solution of type console application, load same assemblies in worker role , execute same code. the emulator (similar azure itself) works on concept of "cloud service". when launch w/ debug, going launch whatever defined in cloud service (.ccproj) project. mimics...

c# - Single statement conditionals - why is the pattern not used for other code blocks? -

just thought i'd see if explain why anders decided valid... if(...) //single statement else ///single statement but not... try //single statement catch //single statement to quote framework design guidelines in section "general style conventions" said braces: avoid omitting braces, if language allows it. braces should not considered optional. single statement blocks, should use braces. increase code readability , maintainability. there limited cases when omitting braces might acceptable, such when adding new statement after existing singöe-line statement either impossible or extremely rare. example, meaningless add statement after throw statement: if(someexpression) throw new argumentoutofrangeexcetion(...); another exception rule braces in case statements. these braces can omitted case and break statements indicate begining , start of block. what anders thinks subjective , argumen...

wsc - Is the RegExp object in VBScript Thread Safe when used inside a Windows Scripting Component -

i've trying track down issue legacy windows scripting component use. looking @ several memory dumps in windbg have found alot of threads, in fact looks 50% of apps threads waiting thread complete. thread has long stack below. thread doing work regexp object, question regexp thread safe? it looks isn't other threads waiting on want before jump conclusions , have struggled find real information online. vbscript!regexpexec::popgreedystar+3a vbscript!regexpexec::fexecaux+639 vbscript!regexpexec::fexec+1f vbscript!regexpexec::exec+5a0 vbscript!regexpexec::replaceusingstring+2d vbscript!cregexp::origreplace+14e vbscript!cregexp::replace+80 oleaut32!dispcallfunc+16a oleaut32!ctypeinfo2::invoke+234 vbscript!cregexp::invoke+24 vbscript!idispatchinvoke2+b2 vbscript!idispatchinvoke+59 vbscript!invokedispatch+13a vbscript!invokebyname+42 vbscript!cscriptruntime::runnoeh+22b2 vbscript!cscriptruntime::run+62 vbscript!csc...

ruby on rails - devise: cannot login if I have a user controller with a show method -

i'm using devise on rails 3 project , i'm trying bdd using cucumber , rspec. the problem when go login using cucumber scenario so: scenario: login given not authenticated , on home page , have user username "jsmith" when follow "log in" , fill in "username" "jsmith" , fill in "password" "password" , press "sign in" should on home page , should see "logged in successfully." , should see "log out" i run problem when i've got following in routes.rb match 'home' => "home#index" devise_for :users, :path_names => { :sign_in => 'login', :sign_out => 'logout'} devise_scope :user '/login' => 'devise/sessions#create' '/logout' => 'devise/sessions#destroy' end resources :users the problem don't see "logged in successfully"...

How should LINQ queries and Dao layer return queries to the view? -

when used use ado.net, used create tableadapters populated using joined queries, example product table adapter have column 'location' if underlying select query joined product location table. in linq, how accomplish this? return columns in joined query writing linq queries in productsdao class? type returning binding gridview? problem retuning linq results have thought break consistency of productsdao class (this should return product rows db). i think best option define classes represent joined data want return (e.g. productdetails ) , return iqueryable<productdetails> data layer. to return queryable, can write simple linq query: public iqueryable<productdetails> getproducts() { return p in db.products join d in db.details on p.id equals d.id select new productdetails { p.name, d.notes }; } this approach has several benefits: you're not exposing yourdatacontext object directly - can stay private field of dao class...